title: How to use Serenity with Junit5?
body: <p>I'm trying to run Serenity Tests in my maven project. I'm using junit-jupiter-engine 5.3.1. (It's in the parent pom.)</p>
  
  <p>I'm getting multiple error.</p>
  
  <p>Is it because the JUnit's version or is there something else?
  How can I solve it?</p>
  
  <p>My test class:</p>
  
  <pre><code>@RunWith(SerenityRunner.class)
  public class MyTestClass {
  
  private static final String CHARACTER_ENCODING_UTF_8 = "UTF-8";
  
  @Steps
  private ApiSteps apiSteps;
  
  
  @Test
  public void aTest() {
  
      try {
          String filePath = "initiatepayment/input.xml";
  
          Client client = Client.create();
  
          WebResource webResource = client
                  .resource("https://jsonplaceholder.typicode.com/posts/42");
  
  //            String input = new Scanner(MyTestClass.class.getClassLoader().getResourceAsStream(filePath), CHARACTER_ENCODING_UTF_8).useDelimiter("\\A").next();
          String input = "{\"address\": \"Budapest\"}";
  
          ClientResponse response = webResource.type("application/json")
                  .get(ClientResponse.class);
  
  
          System.out.println(response.getStatus());
  
          System.out.println("Output from Server .... \n");
          String output = response.getEntity(String.class);
          System.out.println(output);
  
      } catch (Exception e) {
  
          e.printStackTrace();
  
      }
  }
  
  @Test
  public void bTest() {
      apiSteps.sendGetRequest("https://jsonplaceholder.typicode.com/posts/42", WebResourceType.APPLICATION_XML);
      apiSteps.checkStatus(200);
  }
  }
  </code></pre>
  
  <p>My child pom.xml's dependencies:</p>
  
  <pre><code>&lt;properties&gt;
      &lt;serenity-junit.version&gt;1.8.21&lt;/serenity-junit.version&gt;
      &lt;serenity.version&gt;1.35.0&lt;/serenity.version&gt;
      &lt;jersey-client.version&gt;1.19.4&lt;/jersey-client.version&gt;
      &lt;jersey-common.version&gt;2.22.2&lt;/jersey-common.version&gt;
  &lt;/properties&gt;
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax&lt;/groupId&gt;
          &lt;artifactId&gt;javaee-api&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;!--Jersey--&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-client&lt;/artifactId&gt;
          &lt;version&gt;${jersey-client.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.glassfish.jersey.core&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-common&lt;/artifactId&gt;
          &lt;version&gt;${jersey-common.version}&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;!-- test --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.junit.jupiter&lt;/groupId&gt;
          &lt;artifactId&gt;junit-jupiter-engine&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.junit.platform&lt;/groupId&gt;
          &lt;artifactId&gt;junit-platform-launcher&lt;/artifactId&gt;
          &lt;version&gt;${version.junit-platform-launcher}&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;!--Serenity--&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;net.serenity-bdd&lt;/groupId&gt;
          &lt;artifactId&gt;serenity-junit&lt;/artifactId&gt;
          &lt;version&gt;${serenity-junit.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;net.serenity-bdd&lt;/groupId&gt;
          &lt;artifactId&gt;serenity-cucumber&lt;/artifactId&gt;
          &lt;version&gt;${serenity.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;net.serenity-bdd&lt;/groupId&gt;
          &lt;artifactId&gt;serenity-jbehave&lt;/artifactId&gt;
          &lt;version&gt;${serenity.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
  &lt;/dependencies&gt;
  </code></pre>
  
  <p>My ApiSteps class (It extends BaseSteps class which is empty, but that extends the net.thucydides.core.steps.ScenarioSteps class):</p>
  
  <pre><code>public class ApiSteps extends BaseSteps {
  
  private static final String CHARACTER_ENCODING_UTF_8 = "UTF-8";
  private static String message;
  private static ClientResponse clientResponse;
  
  @Step
  public void getMessageByPath(String filePath) {
      message = new Scanner(ApiSteps.class.getClassLoader().getResourceAsStream(filePath), CHARACTER_ENCODING_UTF_8).useDelimiter("\\A").next();
  }
  
  @Step
  public void sendGetRequest(String url, WebResourceType type) {
      Client client = Client.create();
      WebResource webResource = client.resource(url);
      clientResponse = webResource.type(type.getValue()).get(ClientResponse.class);
  }
  
  @Step
  public void sendPostRequest(String url, WebResourceType type) {
      Client client = Client.create();
      WebResource webResource = client.resource(url);
      clientResponse = webResource.type(type.getValue()).post(ClientResponse.class, message);
  }
  
  @Step
  public void checkStatus(int expectedStatusCode) {
      Assert.assertEquals(clientResponse.getStatus(), expectedStatusCode);
  }
  
  }
  </code></pre>
  
  <p>And my stack trace:</p>
  
  <pre><code>java.lang.Exception: No runnable methods
  
  at org.junit.runners.BlockJUnit4ClassRunner.validateInstanceMethods(BlockJUnit4ClassRunner.java:191)
  at org.junit.runners.BlockJUnit4ClassRunner.collectInitializationErrors(BlockJUnit4ClassRunner.java:128)
  at org.junit.runners.ParentRunner.validate(ParentRunner.java:416)
  at org.junit.runners.ParentRunner.&lt;init&gt;(ParentRunner.java:84)
  at org.junit.runners.BlockJUnit4ClassRunner.&lt;init&gt;(BlockJUnit4ClassRunner.java:65)
  at net.serenitybdd.junit.runners.SerenityRunner.&lt;init&gt;(SerenityRunner.java:160)
  at net.serenitybdd.junit.runners.SerenityRunner.&lt;init&gt;(SerenityRunner.java:116)
  at net.serenitybdd.junit.runners.SerenityRunner.&lt;init&gt;(SerenityRunner.java:100)
  
  ....
  
  java.lang.NullPointerException
  at com.khb.openapi.payment.web.bdd.MyTestClass.bTest(MyTestClass.java:55)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  
  ....
  </code></pre>
  
  <p>Thank you!</p>