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.
This commit is contained in:
Dave Syer
2016-11-11 11:53:48 +00:00
parent dcdb7e7f65
commit 1b3496f492

View File

@@ -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 {