1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package test.de.smartics.ci.config.maven;
17
18 import static org.hamcrest.MatcherAssert.assertThat;
19 import static org.hamcrest.Matchers.equalTo;
20 import static org.hamcrest.Matchers.is;
21
22 import org.junit.Before;
23 import org.junit.Test;
24 import org.junit.experimental.categories.Category;
25
26 import de.smartics.ci.config.maven.MavenConfig;
27 import de.smartics.ci.config.maven.MavenPom;
28 import de.smartics.ci.config.maven.MavenSettings;
29 import de.smartics.testdoc.annotations.Uut;
30 import de.smartics.testdoc.categories.type.Construction;
31 import de.smartics.util.lang.NullArgumentException;
32
33
34
35
36 @Uut(type = MavenConfig.class)
37 @Category(Construction.class)
38 public class MavenConfigTest
39 {
40
41
42
43
44
45
46 private MavenPom mavenPom;
47
48 private MavenSettings mavenSettings;
49
50
51
52
53
54
55
56 @Before
57 public void setUp()
58 {
59 mavenPom = new MavenPom();
60 mavenSettings = new MavenSettings();
61 }
62
63
64
65
66
67 @Test(expected = NullArgumentException.class)
68 public void requiresMavenSettingsOnConstruction()
69 {
70 new MavenConfig(null, mavenPom);
71 }
72
73 @Test(expected = NullArgumentException.class)
74 public void requiresMavenPomOnConstruction()
75 {
76 new MavenConfig(mavenSettings, null);
77 }
78
79 @Test
80 public void allowsToAccessAllProperties()
81 {
82 final MavenConfig uut = new MavenConfig(mavenSettings, mavenPom);
83
84 assertThat(uut.getSettings(), is(equalTo(mavenSettings)));
85 assertThat(uut.getPom(), is(equalTo(mavenPom)));
86 }
87 }