blob: d448313fce792d5ca653487d26714764523e6129 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
package org.openecomp.sdc.be.info;
import mockit.Deencapsulation;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.junit.Test;
import org.openecomp.sdc.be.model.ArtifactDefinition;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
public class MergedArtifactInfoTest {
private MergedArtifactInfo createTestSubject() {
MergedArtifactInfo testSubject = new MergedArtifactInfo();
testSubject.setJsonArtifactTemplate(new ArtifactTemplateInfo());
LinkedList<ArtifactDefinition> createdArtifact = new LinkedList<>();
ArtifactDefinition e = new ArtifactDefinition();
e.setArtifactName("mock");
createdArtifact.add(e);
testSubject.setCreatedArtifact(createdArtifact);
return testSubject;
}
@Test
public void testGetCreatedArtifact() throws Exception {
MergedArtifactInfo testSubject;
List<ArtifactDefinition> result;
// default test
testSubject = createTestSubject();
result = testSubject.getCreatedArtifact();
}
@Test
public void testSetCreatedArtifact() throws Exception {
MergedArtifactInfo testSubject;
List<ArtifactDefinition> createdArtifact = new LinkedList<>();
// default test
testSubject = createTestSubject();
testSubject.setCreatedArtifact(createdArtifact);
}
@Test
public void testGetJsonArtifactTemplate() throws Exception {
MergedArtifactInfo testSubject;
ArtifactTemplateInfo result;
// default test
testSubject = createTestSubject();
result = testSubject.getJsonArtifactTemplate();
}
@Test
public void testSetJsonArtifactTemplate() throws Exception {
MergedArtifactInfo testSubject;
ArtifactTemplateInfo jsonArtifactTemplate = new ArtifactTemplateInfo();
// default test
testSubject = createTestSubject();
testSubject.setJsonArtifactTemplate(jsonArtifactTemplate);
}
@Test
public void testGetListToAssociateArtifactToGroup() throws Exception {
MergedArtifactInfo testSubject;
List<ArtifactTemplateInfo> result;
// default test
testSubject = createTestSubject();
result = testSubject.getListToAssociateArtifactToGroup();
}
@Test
public void testGetListToDissotiateArtifactFromGroup() throws Exception {
MergedArtifactInfo testSubject;
List<ArtifactDefinition> deletedArtifacts = new LinkedList<>();
List<ArtifactDefinition> result;
// default test
testSubject = createTestSubject();
result = testSubject.getListToDissotiateArtifactFromGroup(deletedArtifacts);
}
@Test
public void testGetListToUpdateArtifactInGroup() throws Exception {
MergedArtifactInfo testSubject;
List<ImmutablePair<ArtifactDefinition, ArtifactTemplateInfo>> result;
// default test
testSubject = createTestSubject();
result = testSubject.getListToUpdateArtifactInGroup();
}
@Test
public void testGetUpdateArtifactsInGroup() throws Exception {
MergedArtifactInfo testSubject;
List<ImmutablePair<ArtifactDefinition, ArtifactTemplateInfo>> resList = new LinkedList<>();
List<ArtifactTemplateInfo> jsonArtifacts = new LinkedList<>();
// default test
testSubject = createTestSubject();
Deencapsulation.invoke(testSubject, "getUpdateArtifactsInGroup", resList, resList);
}
@Test
public void testGetNewArtifactsInGroup() throws Exception {
MergedArtifactInfo testSubject;
List<ArtifactTemplateInfo> resList = new LinkedList<>();
List<ArtifactTemplateInfo> jsonArtifacts = new LinkedList<>();
// default test
testSubject = createTestSubject();
Deencapsulation.invoke(testSubject, "getNewArtifactsInGroup", resList, resList);
}
@Test
public void testCreateArtifactsGroupSet() throws Exception {
MergedArtifactInfo testSubject;
List<ArtifactTemplateInfo> parsedGroupTemplateList = new LinkedList<>();
Set<String> parsedArtifactsName = new HashSet<>();
// default test
testSubject = createTestSubject();
Deencapsulation.invoke(testSubject, "createArtifactsGroupSet", parsedGroupTemplateList, parsedArtifactsName);
}
}
|