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.is;
20
21 import org.junit.Test;
22 import org.junit.experimental.categories.Category;
23
24 import de.smartics.properties.api.config.domain.key.ApplicationId;
25 import de.smartics.testdoc.annotations.Uut;
26 import de.smartics.testdoc.categories.type.Construction;
27
28
29
30
31 @Category(Construction.class)
32 @Uut(type = ApplicationId.class, method = "valueOf(String")
33 public class ApplicationIdValueOfTest
34 {
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50 @Test
51 public void acceptNull()
52 {
53 final ApplicationId applicationId = ApplicationId.valueOf(null);
54 assertThat(applicationId.toString(), is("::"));
55 }
56
57 @Test
58 public void canBeCreatedWithOnlyAnArtifactId()
59 {
60 final ApplicationId applicationId = ApplicationId.valueOf(":artifactId:");
61 assertThat(applicationId.toString(), is(":artifactId:"));
62 }
63
64 @Test
65 public void canBeCreatedWithOnlyAGroupId()
66 {
67 final ApplicationId applicationId = ApplicationId.valueOf("groupId::");
68 assertThat(applicationId.toString(), is("groupId::"));
69 }
70
71 @Test
72 public void canBeCreatedWithOnlyAVersion()
73 {
74 final ApplicationId applicationId = ApplicationId.valueOf("::version");
75 assertThat(applicationId.toString(), is("::version"));
76 }
77
78
79
80 }