JupiterStories.java

  1. package org.jbehave.core.junit;

  2. import java.util.List;

  3. import org.jbehave.core.ConfigurableEmbedder;
  4. import org.jbehave.core.embedder.Embedder;
  5. import org.junit.jupiter.api.Test;

  6. /**
  7.  * <p>
  8.  * Jupiter-runnable entry-point to run multiple stories specified by {@link #storyPaths()}.
  9.  * The {@link #run()} method is annotated as Jupiter {@link Test}.
  10.  * </p>
  11.  */
  12. public abstract class JupiterStories extends ConfigurableEmbedder {

  13.     @Override
  14.     @Test
  15.     public void run() {
  16.         Embedder embedder = configuredEmbedder();
  17.         try {
  18.             embedder.runStoriesAsPaths(storyPaths());
  19.         } finally {
  20.             embedder.generateSurefireReport();
  21.         }
  22.     }

  23.     public abstract List<String> storyPaths();

  24. }