From d0271aaf8e4dec09a7ccfbf554ed533aee7d82c2 Mon Sep 17 00:00:00 2001 From: azhwani <> Date: Thu, 9 Jul 2020 13:16:27 +0100 Subject: [PATCH] quick fix --- ...ionTest.java => YamlComplexListsUnitTest.java} | 15 +++++++++------ ...ationTest.java => YamlSimpleListUnitTest.java} | 15 +++++++++------ 2 files changed, 18 insertions(+), 12 deletions(-) rename spring-boot-modules/spring-boot-properties-2/src/test/java/com/baeldung/properties/yamllist/{YamlComplexListsIntegrationTest.java => YamlComplexListsUnitTest.java} (56%) rename spring-boot-modules/spring-boot-properties-2/src/test/java/com/baeldung/properties/yamllist/{YamlSimpleListIntegrationTest.java => YamlSimpleListUnitTest.java} (55%) diff --git a/spring-boot-modules/spring-boot-properties-2/src/test/java/com/baeldung/properties/yamllist/YamlComplexListsIntegrationTest.java b/spring-boot-modules/spring-boot-properties-2/src/test/java/com/baeldung/properties/yamllist/YamlComplexListsUnitTest.java similarity index 56% rename from spring-boot-modules/spring-boot-properties-2/src/test/java/com/baeldung/properties/yamllist/YamlComplexListsIntegrationTest.java rename to spring-boot-modules/spring-boot-properties-2/src/test/java/com/baeldung/properties/yamllist/YamlComplexListsUnitTest.java index b0dc881f2a..6dc5d61d09 100644 --- a/spring-boot-modules/spring-boot-properties-2/src/test/java/com/baeldung/properties/yamllist/YamlComplexListsIntegrationTest.java +++ b/spring-boot-modules/spring-boot-properties-2/src/test/java/com/baeldung/properties/yamllist/YamlComplexListsUnitTest.java @@ -3,16 +3,19 @@ package com.baeldung.properties.yamllist; import static org.assertj.core.api.Assertions.assertThat; import org.junit.jupiter.api.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.boot.test.context.ConfigFileApplicationContextInitializer; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit.jupiter.SpringExtension; import com.baeldung.properties.yamllist.pojo.ApplicationProps; -@RunWith(SpringRunner.class) -@SpringBootTest -class YamlComplexListsIntegrationTest { +@ExtendWith(SpringExtension.class) +@ContextConfiguration(initializers = ConfigFileApplicationContextInitializer.class) +@EnableConfigurationProperties(value = ApplicationProps.class) +class YamlComplexListsUnitTest { @Autowired private ApplicationProps applicationProps; diff --git a/spring-boot-modules/spring-boot-properties-2/src/test/java/com/baeldung/properties/yamllist/YamlSimpleListIntegrationTest.java b/spring-boot-modules/spring-boot-properties-2/src/test/java/com/baeldung/properties/yamllist/YamlSimpleListUnitTest.java similarity index 55% rename from spring-boot-modules/spring-boot-properties-2/src/test/java/com/baeldung/properties/yamllist/YamlSimpleListIntegrationTest.java rename to spring-boot-modules/spring-boot-properties-2/src/test/java/com/baeldung/properties/yamllist/YamlSimpleListUnitTest.java index 888ffd13f8..475a73c7d7 100644 --- a/spring-boot-modules/spring-boot-properties-2/src/test/java/com/baeldung/properties/yamllist/YamlSimpleListIntegrationTest.java +++ b/spring-boot-modules/spring-boot-properties-2/src/test/java/com/baeldung/properties/yamllist/YamlSimpleListUnitTest.java @@ -3,16 +3,19 @@ package com.baeldung.properties.yamllist; import static org.assertj.core.api.Assertions.assertThat; import org.junit.jupiter.api.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.boot.test.context.ConfigFileApplicationContextInitializer; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit.jupiter.SpringExtension; import com.baeldung.properties.yamllist.pojo.ApplicationProps; -@RunWith(SpringRunner.class) -@SpringBootTest -class YamlSimpleListIntegrationTest { +@ExtendWith(SpringExtension.class) +@ContextConfiguration(initializers = ConfigFileApplicationContextInitializer.class) +@EnableConfigurationProperties(value = ApplicationProps.class) +class YamlSimpleListUnitTest { @Autowired private ApplicationProps applicationProps;