From dd5e1190fa445295e61b46d35f9fdf5f9b8e56ce Mon Sep 17 00:00:00 2001 From: Cristian Rosu Date: Tue, 2 Jun 2020 22:53:54 +0300 Subject: [PATCH] BAEL-4070: updated test names to match Baeldung's guidelines + makred test as Unit Test instead of Integration Test --- ...ionTest.java => ListsPropertiesUnitTest.java} | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) rename spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/lists/{ListsPropertiesIntegrationTest.java => ListsPropertiesUnitTest.java} (79%) diff --git a/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/lists/ListsPropertiesIntegrationTest.java b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/lists/ListsPropertiesUnitTest.java similarity index 79% rename from spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/lists/ListsPropertiesIntegrationTest.java rename to spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/lists/ListsPropertiesUnitTest.java index 4047e1ea95..8c1835a0a9 100644 --- a/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/lists/ListsPropertiesIntegrationTest.java +++ b/spring-boot-modules/spring-boot-properties/src/test/java/com/baeldung/properties/lists/ListsPropertiesUnitTest.java @@ -16,7 +16,7 @@ import static org.junit.Assert.assertEquals; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = {SpringListPropertiesApplication.class}) -public class ListsPropertiesIntegrationTest { +public class ListsPropertiesUnitTest { @Value("${arrayOfStrings}") private String[] arrayOfStrings; @@ -46,39 +46,39 @@ public class ListsPropertiesIntegrationTest { private Environment environment; @Test - public void givenContextIsInitialized_ThenInjectedArrayContainsExpectedValues() { + public void whenContextIsInitialized_ThenInjectedArrayContainsExpectedValues() { assertEquals(arrayOfStrings, new String[] {"Baeldung", "dot", "com"}); } @Test - public void givenContextIsInitialized_ThenInjectedListContainsUnexpectedValues() { + public void whenContextIsInitialized_ThenInjectedListContainsUnexpectedValues() { assertEquals(unexpectedListOfStrings, Collections.singletonList("Baeldung,dot,com")); } @Test - public void givenContextIsInitialized_ThenInjectedListContainsExpectedValues() { + public void whenContextIsInitialized_ThenInjectedListContainsExpectedValues() { assertEquals(listOfStrings, Arrays.asList("Baeldung", "dot", "com")); } @Test - public void givenContextIsInitialized_ThenInjectedListV2ContainsExpectedValues() { + public void whenContextIsInitialized_ThenInjectedListV2ContainsExpectedValues() { assertEquals(listOfStringsV2, Arrays.asList("Baeldung", "dot", "com")); } @Test - public void givenContextIsInitialized_ThenInjectedListWithCustomDelimiterContainsExpectedValues() { + public void whenContextIsInitialized_ThenInjectedListWithCustomDelimiterContainsExpectedValues() { assertEquals(listOfStringsWithCustomDelimiter, Arrays.asList("Baeldung", "dot", "com")); } @Test - public void givenContextIsInitialized_ThenInjectedListOfBasicTypesContainsExpectedValues() { + public void whenContextIsInitialized_ThenInjectedListOfBasicTypesContainsExpectedValues() { assertEquals(listOfBooleans, Arrays.asList(false, false, true)); assertEquals(listOfIntegers, Arrays.asList(1, 2, 3, 4)); assertEquals(listOfCharacters, Arrays.asList('a', 'b', 'c')); } @Test - public void givenContextIsInitialized_WhenReadingFromEnvironment_ThenPropertiesHaveExpectedValues() { + public void WhenReadingFromSpringEnvironment_ThenPropertiesHaveExpectedValues() { String[] arrayOfStrings = environment.getProperty("arrayOfStrings", String[].class); List listOfStrings = (List)environment.getProperty("arrayOfStrings", List.class);