From 1b3496f4921f95218f59c712f013785c85997b60 Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Fri, 11 Nov 2016 11:53:48 +0000 Subject: [PATCH] Switch off web environment in tests This seems to fix the flickering test problem for me at least. Not sure why yet, so I'll continue to stare at it. --- .../example/loan/LoanApplicationServiceContextPathTests.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/standalone/dsl/http-client/src/test/java/com/example/loan/LoanApplicationServiceContextPathTests.java b/samples/standalone/dsl/http-client/src/test/java/com/example/loan/LoanApplicationServiceContextPathTests.java index 9da4395392..4b9653244a 100644 --- a/samples/standalone/dsl/http-client/src/test/java/com/example/loan/LoanApplicationServiceContextPathTests.java +++ b/samples/standalone/dsl/http-client/src/test/java/com/example/loan/LoanApplicationServiceContextPathTests.java @@ -4,6 +4,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.cloud.contract.stubrunner.spring.AutoConfigureStubRunner; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.junit4.SpringRunner; @@ -17,7 +18,7 @@ import static org.assertj.core.api.Assertions.assertThat; // tag::autoconfigure_stubrunner[] @RunWith(SpringRunner.class) -@SpringBootTest(properties="server.context-path=/app") +@SpringBootTest(webEnvironment=WebEnvironment.NONE, properties="server.context-path=/app") @AutoConfigureStubRunner(ids = {"com.example:http-server-dsl:+:stubs:8080"}, workOffline = true) @DirtiesContext public class LoanApplicationServiceContextPathTests {