1 package org.apache.rat.config;
2
3 import org.apache.rat.api.MetaData;
4 import org.apache.rat.license.GPL1LicenseFamily;
5 import org.apache.rat.license.ILicenseFamily;
6 import org.junit.Test;
7
8 import static org.junit.Assert.assertEquals;
9 import static org.junit.Assert.assertTrue;
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 public class ConfigurationUtilTest {
31 @Test
32 public void toNamesIsNullSafe() {
33 assertTrue(ConfigurationUtil.toNames(null).isEmpty());
34 }
35
36 @Test
37 public void toNamesIsEmptyArraySafe() {
38 assertTrue(ConfigurationUtil.toNames(new ILicenseFamily[0]).isEmpty());
39 }
40 @Test
41 public void toNamesRegular() {
42 assertEquals(MetaData.RAT_LICENSE_FAMILY_NAME_VALUE_GPL_VERSION_1, ConfigurationUtil.toNames(new ILicenseFamily[]{new GPL1LicenseFamily()}).get(0));
43 }
44 }