blob: 707573640bdc555ca2ba42c8bf71bd3184765f05 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
package org.onap.config;
import org.junit.Test;
import java.util.Arrays;
import java.util.List;
import static org.junit.Assert.*;
public class ConfigurationUtilsTest {
@Test
public void testCommaList() {
List list = Arrays.asList("1", "2", 3);
String commaSeparatedList = ConfigurationUtils.getCommaSeparatedList(list);
list.forEach(o -> assertTrue(commaSeparatedList.contains(o.toString())));
}
@Test
public void testCommaListWithNullAndEmptyStrings() {
List list = Arrays.asList(null, "", " ");
String commaSeparatedList = ConfigurationUtils.getCommaSeparatedList(list);
assertTrue(commaSeparatedList.isEmpty());
}
@Test
public void testGetArrayClassFunction() {
assertEquals(String[].class , ConfigurationUtils.getArrayClass(String.class));
assertNull(ConfigurationUtils.getArrayClass(ConfigurationUtilsTest.class));
}
}
|