title: How do I specify test runner in Serenity tests?
body: <p>I created a serenity + JBehave + spring boot test.</p>
  
  <p>The test looks as follows:</p>
  
  <p>Story:</p>
  
  <pre><code>Meta:
  
  Narrative:
  As a new user, in order to efficiently use the service I first want to register to the service and then log in.
  During the process I want to make sure that all validations are properly executed
  
  Scenario: user registration
  Given a user with email address 'test@test.com' and password 'aaa'
  When attempt to register
  Then system returns an information about password being too short
  </code></pre>
  
  <p>Test:</p>
  
  <pre><code>@RunWith(SpringJUnit4ClassRunner.class)
  @SpringApplicationConfiguration(classes = TestServer.class)
  @WebAppConfiguration
  @IntegrationTest({ "server.port=6666" })
  @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
  public class UserRegistrationTest extends SerenityStory {
  
      private String email;
  
      private String password;
  
      @Steps
      private UserRegistrationSteps userRegistrationSteps;
  
      @Given("a user with email address '$email' and password '$password'")
      public void givenAUserWithEmailAndPassword(@Named("email") String email, @Named("password") String password) {
          this.email = email;
          this.password = password;
      }
  
      @When("attempt to register")
      public void attemptToRegister() {
          userRegistrationSteps.openRegistrationPage();
  
          userRegistrationSteps.enterRegistrationCredentials(email, password);
      }
  
      @Then("system returns an information about password being too short")
      public void thenSystemReturnsAnInformationAboutPasswordBeingTooShort() {
          userRegistrationSteps.makeSureRegistrationErrorsContainErrorAboutShortPassword();
      }
  }
  </code></pre>
  
  <p>When I run the test separately everything goes smoothly. First spring boot server starts, it generates some temporary in-memory database and only then the test is executed. If you run the test separately from the other however, the report is not generated. In order to generate reports I need to execute</p>
  
  <blockquote>
    <p>gradle test aggregate</p>
  </blockquote>
  
  <p>unfortunately, when I do that serenity forgets that I have the @RunWith(SpringJUnit4ClassRunner.class) annotation at all. It tries to run the test on the server that doesn't yet exist and as a result the test fails.</p>
  
  <p>Here's also my build.gradle</p>
  
  <pre><code>buildscript {
      ext {
          springBootVersion = '1.2.5.RELEASE'
      }
      repositories {
          mavenCentral()
          jcenter()
      }
      dependencies {
          classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
          classpath("net.serenity-bdd:serenity-gradle-plugin:1.0.59")
      }
  }
  
  group 'fi.achivi.server'
  version '1.0-SNAPSHOT'
  
  apply plugin: 'java'
  apply plugin: 'idea'
  apply plugin: 'spring-boot'
  apply plugin: 'net.serenity-bdd.aggregator'
  
  jar {
      baseName = 'achivi'
      version = '0.0.1-SNAPSHOT'
  }
  
  sourceCompatibility = 1.8
  targetCompatibility = 1.8
  
  gradle.startParameter.continueOnFailure = true
  
  repositories {
      mavenCentral()
      jcenter()
  }
  
  dependencies {
      compile 'org.springframework.boot:spring-boot-starter-thymeleaf', // all spring MVC and spring boot in one dependency
              'org.springframework.boot:spring-boot-starter-data-mongodb',
  
              'commons-validator:commons-validator:1.4.1', // utils
              'org.apache.commons:commons-lang3:3.4',
  
              'org.springframework.security:spring-security-web:4.0.1.RELEASE', //spring security
              'org.springframework.security:spring-security-config:4.0.1.RELEASE'
  
      testCompile 'org.springframework.boot:spring-boot-starter-test',
  
                  'cz.jirutka.spring:embedmongo-spring:1.3.1', //mongodb dependencies
                  'de.flapdoodle.embed:de.flapdoodle.embed.mongo:1.48.0',
  
                  'net.serenity-bdd:core:1.0.47', // JBehave and serenity stuff
                  'net.serenity-bdd:serenity-junit:1.0.47',
                  'net.serenity-bdd:serenity-rest-assured:1.0.59',
                  'org.assertj:assertj-core:1.7.0',
                  'org.slf4j:slf4j-simple:1.7.7',
                  'net.serenity-bdd:serenity-jbehave:1.0.23'
  
  }
  
  
  task wrapper(type: Wrapper) {
      gradleVersion = '2.3'
  }
  </code></pre>
  
  <p>so how do I make serenity take the @RunWith annotation into account when generating reports, so that my server for the tests is actually generated?</p>