title: Running JBehave with Junit 5 Jupiter
body: <p>I'm trying to get some JUnit 4 based JBehave tests running on JUnit 5. In my project I have a single test class for all stories <code>JBehaveTest</code>.</p>
  
  <p>When I run it as a JUnit 5 test JUnit doesn't see any tests. I modified the <code>@Test</code> annotations to their Jupiter equivalents, I changed the <code>assertTrue</code> and <code>assertFalse</code> to their equivalents, etc. </p>
  
  <p>The JUnit 4 test is annotated with a <code>@RunWith</code> annotation, which in JUnit 5 should be a <code>@ExtendWith</code> annotation if I understood correctly. Unfortunately <code>JBehave</code> is not a JUnit 5 extension, so it won't compile.</p>
  
  <p>Can JBehave be used with JUnit 5, and if so, how?</p>
  
  <pre><code>@RunWith(AnnotatedEmbedderRunner.class)
  @UsingEmbedder(embedder = Embedder.class, verboseFailures = true,  ignoreFailureInStories = false, generateViewAfterStories = true)
  public class JBehaveTest implements Embeddable {
  private Embedder embedder;
  private DotStoryReporter dot = new DotStoryReporter();
  private Stage primaryStage;
  
  @Before
  public void createStage() throws TimeoutException {
      Locale locale = new Locale("fa", "IR");
      Locale.setDefault(locale);
      primaryStage = FxToolkit.registerPrimaryStage();
  }
  
  @Override
  @Test
  public void run() throws Throwable {
      embedder.runStoriesAsPaths(new StoryFinder().findPaths("src/test/resources", Collections.singletonList("**/*.story"), Collections.&lt;String&gt;emptyList()));
  }
  
  @Override
  public void useEmbedder(Embedder embedder) {
      this.embedder = embedder;
      MostUsefulConfiguration configuration = new MostUsefulConfiguration();
      Steps steps = new Steps();
      configuration.useStoryReporterBuilder(
              new StoryReporterBuilder()
                      .withCodeLocation(CodeLocations.codeLocationFromClass(JBehaveTest.class))
                      .withDefaultFormats()
                      .withReporters(dot, new MyStoryReporter(new File("test"), steps))
                      .withFormats(Format.HTML, Format.TXT)
                      .withFailureTrace(true)
                      .withFailureTraceCompression(false));
      configuration.useStepdocReporter(new DetailedStepReporter());
  
      embedder.useStepsFactory(new InstanceStepsFactory(configuration, steps));
      embedder.useConfiguration(configuration);
  }
  </code></pre>
  
  <p>The Gradle test dependencies are:</p>
  
  <pre><code>testCompile 'org.junit.jupiter:junit-jupiter-api:5.2.0'
  testCompile 'org.mockito:mockito-core:2.18.3'
  testRuntime 'org.junit.jupiter:junit-jupiter-engine:5.2.0'
  testRuntime 'org.junit.platform:junit-platform-launcher:1.2.0'
  testCompile 'org.testfx:testfx-core:4.0.+'
  testCompile 'org.testfx:testfx-junit5:4.0.+'
  testCompile 'org.jbehave:jbehave-core:4.3.2'
  testCompile 'de.codecentric:jbehave-junit-runner:1.2.0'
  </code></pre>