1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package test.de.smartics.properties.api.config.domain.key;
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.Test;
23 import org.junit.experimental.categories.Category;
24
25 import de.smartics.properties.api.config.domain.key.ApplicationId;
26 import de.smartics.testdoc.annotations.Uut;
27 import de.smartics.testdoc.categories.type.Construction;
28
29
30
31
32 @Uut(type = ApplicationId.class)
33 @Category(Construction.class)
34 public class ApplicationIdConstructionTest
35 {
36 private static final String GROUP_ID = "group";
37
38 private static final String VERSION = "1.0";
39
40 private static final String ARTIFACT_ID = "artifactId";
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56 @Test
57 public void providesAccessToGroupId()
58 {
59 final ApplicationId uut = new ApplicationId(GROUP_ID, ARTIFACT_ID, VERSION);
60 assertThat(uut.getGroupId(), is(equalTo(GROUP_ID)));
61 }
62
63 @Test
64 public void providesAccessToArtifactId()
65 {
66 final ApplicationId uut = new ApplicationId(GROUP_ID, ARTIFACT_ID, VERSION);
67 assertThat(uut.getArtifactId(), is(equalTo(ARTIFACT_ID)));
68 }
69
70 @Test
71 public void providesAccessToVersion()
72 {
73 final ApplicationId uut = new ApplicationId(GROUP_ID, ARTIFACT_ID, VERSION);
74 assertThat(uut.getVersion(), is(equalTo(VERSION)));
75 }
76
77 @Test
78 public void versionNotRequiredOnConstruction()
79 {
80 new ApplicationId(GROUP_ID, ARTIFACT_ID, null);
81 }
82
83 @Test
84 public void groupIdNotRequiredOnConstruction()
85 {
86 new ApplicationId(null, null, null);
87 }
88
89 @Test
90 public void artifactIdNotRequiredOnConstruction()
91 {
92 new ApplicationId(GROUP_ID, null, null);
93 }
94
95
96
97 }