1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package test.de.smartics.ci.config.load;
17
18 import static org.hamcrest.MatcherAssert.assertThat;
19 import static org.hamcrest.Matchers.equalTo;
20 import static org.hamcrest.Matchers.hasItem;
21 import static org.hamcrest.Matchers.is;
22
23 import java.util.List;
24
25 import org.apache.commons.collections.IteratorUtils;
26 import org.junit.Before;
27 import org.junit.Test;
28
29 import de.smartics.ci.config.load.LoaderPlan;
30 import de.smartics.ci.config.maven.MavenConfig;
31 import de.smartics.ci.config.test.MavenConfigBuilder;
32 import de.smartics.testdoc.annotations.Uut;
33
34
35
36
37 public class LoaderPlanTest
38 {
39
40
41
42
43
44
45 @Uut
46 private LoaderPlan uut;
47
48
49
50
51
52
53
54 @Before
55 public void setUp()
56 {
57 final MavenConfig mavenConfig = MavenConfigBuilder.a().build();
58
59 uut = new LoaderPlan("test", mavenConfig);
60 }
61
62
63
64
65
66 @Test
67 @SuppressWarnings("unchecked")
68 public void allowsToAddConfigurationNames()
69 {
70 final String configurationName = "testName";
71
72 assertThat(uut.isEmpty(), is(true));
73
74 uut.addConfigurationName(configurationName);
75
76 assertThat(uut.isEmpty(), is(false));
77
78 final List<String> nameList = IteratorUtils.toList(uut.iterator());
79 assertThat(nameList.size(), is(equalTo(1)));
80 assertThat(nameList, hasItem(configurationName));
81 }
82 }