diff --git a/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/json/JsonTestWithAutoConfigureJsonTestersTests.java b/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/json/JsonTestWithAutoConfigureJsonTestersTests.java index 99006d90cca..1c34491b132 100644 --- a/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/json/JsonTestWithAutoConfigureJsonTestersTests.java +++ b/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/json/JsonTestWithAutoConfigureJsonTestersTests.java @@ -21,9 +21,11 @@ import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.json.app.ExampleBasicObject; +import org.springframework.boot.test.autoconfigure.json.app.ExampleJsonApplication; import org.springframework.boot.test.json.BasicJsonTester; import org.springframework.boot.test.json.GsonTester; import org.springframework.boot.test.json.JacksonTester; +import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringRunner; import static org.assertj.core.api.Assertions.assertThat; @@ -36,6 +38,7 @@ import static org.assertj.core.api.Assertions.assertThat; @RunWith(SpringRunner.class) @JsonTest @AutoConfigureJsonTesters(enabled = false) +@ContextConfiguration(classes = ExampleJsonApplication.class) public class JsonTestWithAutoConfigureJsonTestersTests { @Autowired(required = false) diff --git a/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/json/SpringBootTestWithAutoConfigureJsonTestersTests.java b/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/json/SpringBootTestWithAutoConfigureJsonTestersTests.java index da5753b9960..5137c66c3ea 100644 --- a/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/json/SpringBootTestWithAutoConfigureJsonTestersTests.java +++ b/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/json/SpringBootTestWithAutoConfigureJsonTestersTests.java @@ -21,10 +21,12 @@ import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.json.app.ExampleBasicObject; +import org.springframework.boot.test.autoconfigure.json.app.ExampleJsonApplication; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.json.BasicJsonTester; import org.springframework.boot.test.json.GsonTester; import org.springframework.boot.test.json.JacksonTester; +import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringRunner; /** @@ -35,6 +37,7 @@ import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest @AutoConfigureJsonTesters +@ContextConfiguration(classes = ExampleJsonApplication.class) public class SpringBootTestWithAutoConfigureJsonTestersTests { @Autowired