title: tests for spring boot application are not run
body: <p>I am trying to write an integration for Spring Boot application:</p>
  
  <pre><code>import org.springframework.boot.SpringApplication;
  import org.springframework.boot.context.web.SpringBootServletInitializer;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  import org.springframework.boot.web.servlet.ServletRegistrationBean;
  import org.springframework.context.annotation.Bean;
  import org.springframework.context.annotation.ComponentScan;
  
  @SpringBootApplication
  @ComponentScan(basePackages = { "com.lapots.tree.model.web" })
  public class TreeModelApplication extends SpringBootServletInitializer {
  
      public static void main(String[] args) {
          SpringApplication.run(TreeModelApplication.class, args);
      }
  
      @Bean
      public ServletRegistrationBean servletRegistrationBean() throws Exception {
          ServletRegistrationBean registrationBean = new ServletRegistrationBean(new RootServlet(), "/tree-model-app");
          registrationBean.setLoadOnStartup(1);
          registrationBean.setAsyncSupported(true);
          return registrationBean;
      }
  }
  </code></pre>
  
  <p>The test looks like this</p>
  
  <pre><code>import org.junit.jupiter.api.Test;
  import org.junit.jupiter.api.extension.ExtendWith;
  import org.springframework.boot.test.context.SpringBootTest;
  import org.springframework.test.context.junit.jupiter.SpringExtension;
  import org.springframework.web.client.RestTemplate;
  
  import static org.junit.jupiter.api.Assertions.assertEquals;
  
  @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
          classes = TreeModelApplication.class)
  @ExtendWith(SpringExtension.class)
  public class TreeModelApplicationIntegrationTest {
      private static final String PING_URL = "http://localhost:8080/tree-model-app/ping";
  
      private RestTemplate restTemplate = new RestTemplate();
  
      @Test
      public void routerReturnsTrueOnPing() {
          String response = restTemplate.getForObject(PING_URL, String.class);
          assertEquals("false", response, "Ping response should be the same as expected.");
      }
  }
  </code></pre>
  
  <p>However when I run <code>gradlew test</code> - nothing happens - build successful and reports are empty. What is the problem?</p>
  
  <p>My <code>build.gradle</code> is</p>
  
  <pre><code>buildscript {
      ext {
          springBootVersion = '2.0.0.BUILD-SNAPSHOT'
      }
      repositories {
          mavenCentral()
          maven { url "https://repo.spring.io/snapshot" }
          maven { url "https://repo.spring.io/milestone" }
      }
      dependencies {
          classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
      }
  }
  
  apply plugin: 'java'
  apply plugin: 'war'
  apply plugin: 'org.springframework.boot'
  apply plugin: 'io.spring.dependency-management'
  
  version = '0.0.1-SNAPSHOT'
  sourceCompatibility = 1.8
  
  repositories {
      jcenter()
      maven { url "https://repo.spring.io/snapshot" }
      maven { url "https://repo.spring.io/milestone" }
      maven { url 'https://jitpack.io' }
  }
  
  dependencies {
      compile('org.springframework.boot:spring-boot-starter-actuator')
      compile('org.springframework.boot:spring-boot-starter-data-jpa')
      compile('org.springframework.boot:spring-boot-starter-web')
      compile('org.springframework.boot:spring-boot-starter-webflux')
      compile('org.springframework.boot:spring-boot-starter-websocket')
      compile('org.springframework.boot:spring-boot-starter-jetty')
  
      runtime('org.springframework.boot:spring-boot-devtools')
  
      testCompile('org.springframework.boot:spring-boot-starter-test')
      testCompile("org.springframework:spring-test")
      testCompile("org.junit.platform:junit-platform-runner:$junitPlatformVersion")
      testCompile("org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion")
      testCompile("org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion")
      testCompile("com.github.sbrannen:spring-test-junit5:1.0.0.M4")
  }
  </code></pre>