Интеграционный тест с Spring Boot и Spock

Каков наилучший способ выполнить интеграционный тест (например,@IntegrationTest) со споком? Я хотел бы загрузить все приложение Spring Boot и выполнить несколько HTTP-вызовов для проверки всей функциональности.

Я могу сделать это с помощью JUnit (сначала запускается приложение, а затем выполняются тесты):

@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = MyServer.class)
@WebAppConfiguration
@IntegrationTest
class MyTest {
   RestTemplate template = new TestRestTemplate();

   @Test
   public void testDataRoutingWebSocketToHttp() {
      def a = template.getForEntity("http://localhost:8080", String.class)
      println a
   }
}

Но со Споком приложение не запускается:

@SpringApplicationConfiguration(classes = MyServer.class)
@WebAppConfiguration
@IntegrationTest
class MyTestSpec extends Specification {

   RestTemplate template = new TestRestTemplate();

   def "Do my test"() {
      setup:
      def a = template.getForEntity("http://localhost:8080", String.class)

      expect:
      println a
   }
}

Конечно, для Спока я указал правильные зависимости в моем файле сборки Gradle:

...
dependencies {
   testCompile 'org.spockframework:spock-core:0.7-groovy-2.0'
   testCompile 'org.spockframework:spock-spring:0.7-groovy-2.0'
}
...

Я что-то пропустил?

Ответы на вопрос(3)

Ваш ответ на вопрос