@Test public void testCreateShouldCreateConfiguration() { JBehaveTestCase testCase = new JBehaveTestCase() { @Override protected String getStoryPath() { return "something"; } }; GherkinStoryParser gherkinStoryParser = new GherkinStoryParser(); StoryReporterBuilder storyReporterBuilder = new StoryReporterBuilder().withReporters(new JBehaveStoryReporter(testCase)); FailingUponPendingStep pendingStepStrategy = new FailingUponPendingStep(); given(storyParserFactory.createGherkinStoryParser()).willReturn(gherkinStoryParser); given(pendingStepStrategyFactory.createFailingUponPendingStep()).willReturn(pendingStepStrategy); given(storyReporterBuilderFactory.createForTestCase(testCase)).willReturn(storyReporterBuilder); Configuration result = underTest.create(testCase); assertEquals(gherkinStoryParser, result.storyParser()); assertEquals(pendingStepStrategy, result.pendingStepStrategy()); assertEquals(storyReporterBuilder, result.storyReporterBuilder()); }
public Configuration create(final JBehaveTestCase testCase) { Configuration configuration = new MostUsefulConfiguration(); GherkinStoryParser gherkinStoryParser = storyParserFactory.createGherkinStoryParser(); configuration.useStoryParser(gherkinStoryParser); StoryReporterBuilder storyReporterBuilder = storyReporterBuilderFactory.createForTestCase(testCase); configuration.useStoryReporterBuilder(storyReporterBuilder); FailingUponPendingStep pendingStepStrategy = pendingStepStrategyFactory.createFailingUponPendingStep(); configuration.usePendingStepStrategy(pendingStepStrategy); return configuration; }
ConfigurationFactory { public Configuration create(final JBehaveTestCase testCase) { Configuration configuration = new MostUsefulConfiguration(); GherkinStoryParser gherkinStoryParser = storyParserFactory.createGherkinStoryParser(); configuration.useStoryParser(gherkinStoryParser); StoryReporterBuilder storyReporterBuilder = storyReporterBuilderFactory.createForTestCase(testCase); configuration.useStoryReporterBuilder(storyReporterBuilder); FailingUponPendingStep pendingStepStrategy = pendingStepStrategyFactory.createFailingUponPendingStep(); configuration.usePendingStepStrategy(pendingStepStrategy); return configuration; } }
ConfigurationFactory { public Configuration create(final JBehaveTestCase testCase) { Configuration configuration = new MostUsefulConfiguration(); GherkinStoryParser gherkinStoryParser = storyParserFactory.createGherkinStoryParser(); configuration.useStoryParser(gherkinStoryParser); StoryReporterBuilder storyReporterBuilder = storyReporterBuilderFactory.createForTestCase(testCase); configuration.useStoryReporterBuilder(storyReporterBuilder); FailingUponPendingStep pendingStepStrategy = pendingStepStrategyFactory.createFailingUponPendingStep(); configuration.usePendingStepStrategy(pendingStepStrategy); return configuration; }  }
ConfigurationFactory { public Configuration create(final JBehaveTestCase testCase) { Configuration configuration = new MostUsefulConfiguration(); GherkinStoryParser gherkinStoryParser = storyParserFactory.createGherkinStoryParser(); configuration.useStoryParser(gherkinStoryParser); StoryReporterBuilder storyReporterBuilder = storyReporterBuilderFactory.createForTestCase(testCase); configuration.useStoryReporterBuilder(storyReporterBuilder); FailingUponPendingStep pendingStepStrategy = pendingStepStrategyFactory.createFailingUponPendingStep(); configuration.usePendingStepStrategy(pendingStepStrategy); return configuration; }  Configuration create(final JBehaveTestCase testCase); }
ConfigurationFactory { public Configuration create(final JBehaveTestCase testCase) { Configuration configuration = new MostUsefulConfiguration(); GherkinStoryParser gherkinStoryParser = storyParserFactory.createGherkinStoryParser(); configuration.useStoryParser(gherkinStoryParser); StoryReporterBuilder storyReporterBuilder = storyReporterBuilderFactory.createForTestCase(testCase); configuration.useStoryReporterBuilder(storyReporterBuilder); FailingUponPendingStep pendingStepStrategy = pendingStepStrategyFactory.createFailingUponPendingStep(); configuration.usePendingStepStrategy(pendingStepStrategy); return configuration; }  Configuration create(final JBehaveTestCase testCase);  }