BAEL-4070: updated test names and parameter ordering + moved code to spring-boot-properties-2
This commit is contained in:
parent
bc2c23ae9e
commit
c098ffa7e9
|
@ -46,43 +46,43 @@ public class ListsPropertiesUnitTest {
|
||||||
private Environment environment;
|
private Environment environment;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenContextIsInitialized_ThenInjectedArrayContainsExpectedValues() {
|
public void whenContextIsInitialized_thenInjectedArrayContainsExpectedValues() {
|
||||||
assertEquals(arrayOfStrings, new String[] {"Baeldung", "dot", "com"});
|
assertEquals(new String[] {"Baeldung", "dot", "com"}, arrayOfStrings);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenContextIsInitialized_ThenInjectedListContainsUnexpectedValues() {
|
public void whenContextIsInitialized_thenInjectedListContainsUnexpectedValues() {
|
||||||
assertEquals(unexpectedListOfStrings, Collections.singletonList("Baeldung,dot,com"));
|
assertEquals(Collections.singletonList("Baeldung,dot,com"), unexpectedListOfStrings);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenContextIsInitialized_ThenInjectedListContainsExpectedValues() {
|
public void whenContextIsInitialized_thenInjectedListContainsExpectedValues() {
|
||||||
assertEquals(listOfStrings, Arrays.asList("Baeldung", "dot", "com"));
|
assertEquals(Arrays.asList("Baeldung", "dot", "com"), listOfStrings);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenContextIsInitialized_ThenInjectedListV2ContainsExpectedValues() {
|
public void whenContextIsInitialized_thenInjectedListV2ContainsExpectedValues() {
|
||||||
assertEquals(listOfStringsV2, Arrays.asList("Baeldung", "dot", "com"));
|
assertEquals(Arrays.asList("Baeldung", "dot", "com"), listOfStringsV2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenContextIsInitialized_ThenInjectedListWithCustomDelimiterContainsExpectedValues() {
|
public void whenContextIsInitialized_thenInjectedListWithCustomDelimiterContainsExpectedValues() {
|
||||||
assertEquals(listOfStringsWithCustomDelimiter, Arrays.asList("Baeldung", "dot", "com"));
|
assertEquals(Arrays.asList("Baeldung", "dot", "com"), listOfStringsWithCustomDelimiter);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenContextIsInitialized_ThenInjectedListOfBasicTypesContainsExpectedValues() {
|
public void whenContextIsInitialized_thenInjectedListOfBasicTypesContainsExpectedValues() {
|
||||||
assertEquals(listOfBooleans, Arrays.asList(false, false, true));
|
assertEquals(Arrays.asList(false, false, true), listOfBooleans);
|
||||||
assertEquals(listOfIntegers, Arrays.asList(1, 2, 3, 4));
|
assertEquals(Arrays.asList(1, 2, 3, 4), listOfIntegers);
|
||||||
assertEquals(listOfCharacters, Arrays.asList('a', 'b', 'c'));
|
assertEquals(Arrays.asList('a', 'b', 'c'), listOfCharacters);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenReadingFromSpringEnvironment_ThenPropertiesHaveExpectedValues() {
|
public void whenReadingFromSpringEnvironment_thenPropertiesHaveExpectedValues() {
|
||||||
String[] arrayOfStrings = environment.getProperty("arrayOfStrings", String[].class);
|
String[] arrayOfStrings = environment.getProperty("arrayOfStrings", String[].class);
|
||||||
List<String> listOfStrings = (List<String>)environment.getProperty("arrayOfStrings", List.class);
|
List<String> listOfStrings = (List<String>)environment.getProperty("arrayOfStrings", List.class);
|
||||||
|
|
||||||
assertEquals(arrayOfStrings, new String[] {"Baeldung", "dot", "com"});
|
assertEquals(new String[] {"Baeldung", "dot", "com"}, arrayOfStrings);
|
||||||
assertEquals(listOfStrings, Arrays.asList("Baeldung", "dot", "com"));
|
assertEquals(Arrays.asList("Baeldung", "dot", "com"), listOfStrings);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue