diff --git a/pom.xml b/pom.xml index ce0dbfb..7a56c3c 100644 --- a/pom.xml +++ b/pom.xml @@ -70,8 +70,9 @@ 11 5.2.0 - 4.13.2 + 5.10.1 5.7.0 + 2.2 3.11.0 3.3.0 3.6.2 @@ -185,37 +186,49 @@ org.jbehave jbehave-core - provided ${jbehave.version} - junit - junit - ${junit.version} + + org.junit.jupiter + junit-jupiter-api + + ${junit.version} org.mockito - mockito-core + + mockito-core ${mockito.version} test + + org.hamcrest + hamcrest + ${hamcrest.version} + test + - sign-artifacts + + sign-artifacts false - org.apache.maven.plugins + + org.apache.maven.plugins maven-gpg-plugin - ${apache.maven-gpg-plugin.version} + + ${apache.maven-gpg-plugin.version} - sign-artifacts + + sign-artifacts verify sign @@ -227,7 +240,8 @@ - ci + + ci env.CI @@ -237,15 +251,18 @@ - org.jacoco + + org.jacoco jacoco-maven-plugin - ${jacoco.jacoco-maven-plugin.version} + + ${jacoco.jacoco-maven-plugin.version} - pre-unit-test + + pre-unit-test prepare-agent @@ -253,7 +270,8 @@ - post-unit-test + + post-unit-test test report @@ -262,14 +280,19 @@ - org.eluder.coveralls + + org.eluder.coveralls coveralls-maven-plugin - ${eluder.coveralls-maven-plugin.version} + + ${eluder.coveralls-maven-plugin.version} - jakarta.xml.bind - jakarta.xml.bind-api - ${jakarta.xml.bind-api.version} + + jakarta.xml.bind + + jakarta.xml.bind-api + + ${jakarta.xml.bind-api.version} diff --git a/src/test/java/com/github/TurquoiseSpace/jbehave/junit/monitoring/JUnitDescriptionGeneratorTest.java b/src/test/java/com/github/TurquoiseSpace/jbehave/junit/monitoring/JUnitDescriptionGeneratorTest.java index 3e619e3..9cb3878 100644 --- a/src/test/java/com/github/TurquoiseSpace/jbehave/junit/monitoring/JUnitDescriptionGeneratorTest.java +++ b/src/test/java/com/github/TurquoiseSpace/jbehave/junit/monitoring/JUnitDescriptionGeneratorTest.java @@ -22,6 +22,7 @@ import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Collections; +import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; @@ -335,8 +336,15 @@ public void shouldCountBeforeScenarioStepWithExampleType() { private void mockListBeforeOrAfterScenarioCall(ScenarioType... scenarioTypes) { Method method = new Object(){}.getClass().getEnclosingMethod(); for(ScenarioType scenarioType : scenarioTypes) { - when(steps.listBeforeOrAfterScenario(scenarioType)).thenReturn( - singletonList(new BeforeOrAfterStep(Stage.BEFORE, method, null))); + List list = singletonList(new BeforeOrAfterStep(method, 1, Outcome.ANY, null)); + Map> map = new HashMap>(); + map.put(scenarioType, list); + when(steps.listBeforeScenario()).thenReturn(map); + + list = singletonList(new BeforeOrAfterStep(method, 1, Outcome.ANY, null)); + map = new HashMap>(); + map.put(scenarioType, list); + when(steps.listAfterScenario()).thenReturn(map); } } @@ -359,7 +367,7 @@ private List createDescriptionFrom(boolean storyAllowed, boolean sc story.getScenarios()); PerformableStory performableStory = mock(PerformableStory.class); - when(performableStory.isAllowed()).thenReturn(Boolean.valueOf(storyAllowed)); + when(performableStory.isExcluded()).thenReturn(Boolean.valueOf(!storyAllowed)); when(performableStory.getStory()).thenReturn(story); when(performableStory.getScenarios()).thenReturn(performableScenarios); @@ -387,7 +395,7 @@ private List mockPerformableScenarios(String storyPath, boo private PerformableScenario mockPerformableScenario(Scenario scenario, String storyPath, boolean allowed) { PerformableScenario performableScenario = new PerformableScenario(scenario, storyPath); - performableScenario.allowed(allowed); + performableScenario.excluded(!allowed); if (scenario.hasExamplesTable()) { for (Map row : scenario.getExamplesTable().getRows()) { ExamplePerformableScenario exampleScenario = mock(ExamplePerformableScenario.class); diff --git a/src/test/java/com/github/TurquoiseSpace/jbehave/junit/monitoring/StoryPathsExtractorTest.java b/src/test/java/com/github/TurquoiseSpace/jbehave/junit/monitoring/StoryPathsExtractorTest.java index 7bad845..886bace 100644 --- a/src/test/java/com/github/TurquoiseSpace/jbehave/junit/monitoring/StoryPathsExtractorTest.java +++ b/src/test/java/com/github/TurquoiseSpace/jbehave/junit/monitoring/StoryPathsExtractorTest.java @@ -59,7 +59,7 @@ public static class TestJUnitStory extends JUnitStory { public static class TestJUnitStories extends JUnitStories { @Override - protected List storyPaths() { + public List storyPaths() { return JUNIT_STORIES_PATHS; } } diff --git a/src/test/java/com/github/TurquoiseSpace/jbehave/junit/monitoring/story/ExampleScenarioJUnitStories.java b/src/test/java/com/github/TurquoiseSpace/jbehave/junit/monitoring/story/ExampleScenarioJUnitStories.java index ab6c6c8..a5f7d55 100644 --- a/src/test/java/com/github/TurquoiseSpace/jbehave/junit/monitoring/story/ExampleScenarioJUnitStories.java +++ b/src/test/java/com/github/TurquoiseSpace/jbehave/junit/monitoring/story/ExampleScenarioJUnitStories.java @@ -31,7 +31,7 @@ public Configuration configuration() { } @Override - protected List storyPaths() { + public List storyPaths() { return Arrays.asList("com/github/TurquoiseSpace/jbehave/junit/monitoring/story/Multiplication.story", "com/github/TurquoiseSpace/jbehave/junit/monitoring/story/Empty.story"); } diff --git a/src/test/java/com/github/TurquoiseSpace/jbehave/junit/monitoring/story/ExampleScenarioJUnitStoriesLocalized.java b/src/test/java/com/github/TurquoiseSpace/jbehave/junit/monitoring/story/ExampleScenarioJUnitStoriesLocalized.java index 5bc729a..7f5cad8 100644 --- a/src/test/java/com/github/TurquoiseSpace/jbehave/junit/monitoring/story/ExampleScenarioJUnitStoriesLocalized.java +++ b/src/test/java/com/github/TurquoiseSpace/jbehave/junit/monitoring/story/ExampleScenarioJUnitStoriesLocalized.java @@ -8,7 +8,6 @@ import org.jbehave.core.configuration.Configuration; import org.jbehave.core.i18n.LocalizedKeywords; -import org.jbehave.core.parsers.RegexStoryParser; import org.junit.runner.RunWith; @RunWith(JUnitReportingRunner.class) @@ -17,17 +16,11 @@ public class ExampleScenarioJUnitStoriesLocalized extends ExampleScenarioJUnitSt @Override public Configuration configuration() { - LocalizedKeywords keywords = new LocalizedKeywords(Locale.GERMAN); - Configuration configuration = super.configuration(); - RegexStoryParser storyParser = new RegexStoryParser(keywords, configuration.storyLoader(), - configuration.tableTransformers()); - return configuration - .useKeywords(keywords) - .useStoryParser(storyParser); + return super.configuration().useKeywords(new LocalizedKeywords(Locale.GERMAN)); } @Override - protected List storyPaths() { + public List storyPaths() { return Collections.singletonList("com/github/TurquoiseSpace/jbehave/junit/monitoring/story/Multiplication_de.story"); } } diff --git a/src/test/java/com/github/TurquoiseSpace/jbehave/junit/monitoring/story/MathStories.java b/src/test/java/com/github/TurquoiseSpace/jbehave/junit/monitoring/story/MathStories.java index f7df4fb..b0403bc 100644 --- a/src/test/java/com/github/TurquoiseSpace/jbehave/junit/monitoring/story/MathStories.java +++ b/src/test/java/com/github/TurquoiseSpace/jbehave/junit/monitoring/story/MathStories.java @@ -45,7 +45,7 @@ public InjectableStepsFactory stepsFactory() { } @Override - protected List storyPaths() { + public List storyPaths() { return Collections.singletonList("com/github/TurquoiseSpace/jbehave/junit/monitoring/story/Multiplication.story"); } diff --git a/src/test/java/com/github/TurquoiseSpace/jbehave/junit/monitoring/story/StoriesWithAllSortsOfBeforeAndAfter.java b/src/test/java/com/github/TurquoiseSpace/jbehave/junit/monitoring/story/StoriesWithAllSortsOfBeforeAndAfter.java index b66b585..984dba6 100644 --- a/src/test/java/com/github/TurquoiseSpace/jbehave/junit/monitoring/story/StoriesWithAllSortsOfBeforeAndAfter.java +++ b/src/test/java/com/github/TurquoiseSpace/jbehave/junit/monitoring/story/StoriesWithAllSortsOfBeforeAndAfter.java @@ -11,12 +11,12 @@ import org.jbehave.core.failures.FailingUponPendingStep; import org.jbehave.core.io.LoadFromClasspath; import org.jbehave.core.junit.JUnitStories; -import org.jbehave.core.reporters.CrossReference; import org.jbehave.core.reporters.Format; import org.jbehave.core.reporters.StoryReporterBuilder; import org.jbehave.core.steps.DelegatingStepMonitor; import org.jbehave.core.steps.InjectableStepsFactory; import org.jbehave.core.steps.InstanceStepsFactory; +import org.jbehave.core.steps.NullStepMonitor; import org.jbehave.core.steps.ParameterControls; import org.jbehave.core.steps.StepMonitor; import org.junit.runner.RunWith; @@ -38,19 +38,15 @@ public class StoriesWithAllSortsOfBeforeAndAfter extends JUnitStories { private final Configuration configuration; public StoriesWithAllSortsOfBeforeAndAfter() { - CrossReference crossReference = new CrossReference("dummy") - .withJsonOnly().withOutputAfterEachStory(true) - .excludingStoriesWithNoExecutedScenarios(true); StepMonitor stepMonitor = new DelegatingStepMonitor( - crossReference.getStepMonitor()); + new NullStepMonitor()); configuration = new MostUsefulConfiguration() .useStepMonitor(stepMonitor) .usePendingStepStrategy(new FailingUponPendingStep()) .useStoryReporterBuilder( new StoryReporterBuilder().withDefaultFormats() .withFailureTrace(true) - .withFormats(Format.XML, Format.HTML) - .withCrossReference(crossReference)) + .withFormats(Format.XML, Format.HTML)) .useParameterControls(new ParameterControls("<", ">", true)); JUnitReportingRunner.recommendedControls(configuredEmbedder()); } @@ -70,7 +66,7 @@ public InjectableStepsFactory stepsFactory() { } @Override - protected List storyPaths() { + public List storyPaths() { return Collections.singletonList( "com/github/TurquoiseSpace/jbehave/junit/monitoring/story/MultiplicationWithExamplesAndGiven.story"); }