diff --git a/testing-modules/spring-testing/pom.xml b/testing-modules/spring-testing/pom.xml index 8a76dc903c..15431cfb77 100644 --- a/testing-modules/spring-testing/pom.xml +++ b/testing-modules/spring-testing/pom.xml @@ -84,6 +84,11 @@ ${junit.jupiter.version} test + + org.junit.platform + junit-platform-commons + ${junit.commons.version} + org.awaitility awaitility @@ -112,7 +117,8 @@ 2.0.0.0 3.1.6 - 5.4.0 + 5.5.0 + 1.5.2 5.1.4.RELEASE 4.0.1 2.1.1 diff --git a/testing-modules/spring-testing/src/test/java/com/baeldung/dirtiescontext/DirtiesContextIntegrationTest.java b/testing-modules/spring-testing/src/test/java/com/baeldung/dirtiescontext/DirtiesContextIntegrationTest.java index f3e7b8c228..7afd4a22d4 100644 --- a/testing-modules/spring-testing/src/test/java/com/baeldung/dirtiescontext/DirtiesContextIntegrationTest.java +++ b/testing-modules/spring-testing/src/test/java/com/baeldung/dirtiescontext/DirtiesContextIntegrationTest.java @@ -10,10 +10,12 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.annotation.DirtiesContext.MethodMode; import org.springframework.test.context.junit.jupiter.SpringExtension; +import org.springframework.web.servlet.config.annotation.EnableWebMvc; @TestMethodOrder(OrderAnnotation.class) @ExtendWith(SpringExtension.class) @SpringBootTest(classes = SpringDataRestApplication.class) +@EnableWebMvc class DirtiesContextIntegrationTest { @Autowired diff --git a/testing-modules/spring-testing/src/test/java/com/baeldung/overrideproperties/ProfilePropertySourceResolverIntegrationTest.java b/testing-modules/spring-testing/src/test/java/com/baeldung/overrideproperties/ProfilePropertySourceResolverIntegrationTest.java index 95d83420b7..815b628f0a 100644 --- a/testing-modules/spring-testing/src/test/java/com/baeldung/overrideproperties/ProfilePropertySourceResolverIntegrationTest.java +++ b/testing-modules/spring-testing/src/test/java/com/baeldung/overrideproperties/ProfilePropertySourceResolverIntegrationTest.java @@ -1,21 +1,25 @@ package com.baeldung.overrideproperties; -import com.baeldung.overrideproperties.resolver.PropertySourceResolver; +import static org.junit.Assert.assertEquals; + 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.test.context.ActiveProfiles; import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.web.servlet.config.annotation.EnableWebMvc; -import static org.junit.Assert.assertEquals; +import com.baeldung.overrideproperties.resolver.PropertySourceResolver; @RunWith(SpringRunner.class) @SpringBootTest @ActiveProfiles("test") +@EnableWebMvc public class ProfilePropertySourceResolverIntegrationTest { - @Autowired private PropertySourceResolver propertySourceResolver; + @Autowired + private PropertySourceResolver propertySourceResolver; @Test public void shouldProfiledProperty_overridePropertyValues() { diff --git a/testing-modules/spring-testing/src/test/java/com/baeldung/overrideproperties/SpringBootPropertySourceResolverIntegrationTest.java b/testing-modules/spring-testing/src/test/java/com/baeldung/overrideproperties/SpringBootPropertySourceResolverIntegrationTest.java index 573a46dd5f..d00aa51e6c 100644 --- a/testing-modules/spring-testing/src/test/java/com/baeldung/overrideproperties/SpringBootPropertySourceResolverIntegrationTest.java +++ b/testing-modules/spring-testing/src/test/java/com/baeldung/overrideproperties/SpringBootPropertySourceResolverIntegrationTest.java @@ -1,18 +1,22 @@ package com.baeldung.overrideproperties; -import com.baeldung.overrideproperties.resolver.PropertySourceResolver; import org.junit.Assert; 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.test.context.junit4.SpringRunner; +import org.springframework.web.servlet.config.annotation.EnableWebMvc; + +import com.baeldung.overrideproperties.resolver.PropertySourceResolver; @RunWith(SpringRunner.class) @SpringBootTest(properties = { "example.firstProperty=annotation" }) +@EnableWebMvc public class SpringBootPropertySourceResolverIntegrationTest { - @Autowired private PropertySourceResolver propertySourceResolver; + @Autowired + private PropertySourceResolver propertySourceResolver; @Test public void shouldSpringBootTestAnnotation_overridePropertyValues() { diff --git a/testing-modules/spring-testing/src/test/java/com/baeldung/overrideproperties/TestResourcePropertySourceResolverIntegrationTest.java b/testing-modules/spring-testing/src/test/java/com/baeldung/overrideproperties/TestResourcePropertySourceResolverIntegrationTest.java index c724713854..dc15851277 100644 --- a/testing-modules/spring-testing/src/test/java/com/baeldung/overrideproperties/TestResourcePropertySourceResolverIntegrationTest.java +++ b/testing-modules/spring-testing/src/test/java/com/baeldung/overrideproperties/TestResourcePropertySourceResolverIntegrationTest.java @@ -1,19 +1,23 @@ package com.baeldung.overrideproperties; -import com.baeldung.overrideproperties.resolver.PropertySourceResolver; +import static org.junit.Assert.assertEquals; + 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.test.context.junit4.SpringRunner; +import org.springframework.web.servlet.config.annotation.EnableWebMvc; -import static org.junit.Assert.assertEquals; +import com.baeldung.overrideproperties.resolver.PropertySourceResolver; @RunWith(SpringRunner.class) @SpringBootTest +@EnableWebMvc public class TestResourcePropertySourceResolverIntegrationTest { - @Autowired private PropertySourceResolver propertySourceResolver; + @Autowired + private PropertySourceResolver propertySourceResolver; @Test public void shouldTestResourceFile_overridePropertyValues() {