blob: 7819b4c9f4aa7e171f6fffb35e093e2017784dc9 (
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
|
package org.onap.vid.services;
import static org.junit.Assert.*;
import java.util.*;
import org.json.simple.JSONArray;
import org.junit.Assert;
import org.junit.Test;
import org.onap.portalsdk.core.service.DataAccessService;
import org.onap.portalsdk.core.service.DataAccessServiceImpl;
import org.onap.vid.changeManagement.ChangeManagementRequest;
import org.onap.vid.changeManagement.GetVnfWorkflowRelationRequest;
import org.onap.vid.changeManagement.RequestDetails;
import org.onap.vid.changeManagement.VnfWorkflowRelationAllResponse;
import org.onap.vid.changeManagement.VnfWorkflowRelationRequest;
import org.onap.vid.changeManagement.VnfWorkflowRelationResponse;
import org.onap.vid.mso.MsoBusinessLogic;
import org.onap.vid.mso.MsoBusinessLogicImpl;
import org.onap.vid.mso.rest.MsoRestClientNew;
import org.onap.vid.mso.rest.Request;
import org.springframework.http.ResponseEntity;
import org.springframework.web.multipart.MultipartFile;
public class ChangeManagementServiceImplTest {
private ChangeManagementServiceImpl createTestSubject() {
return new ChangeManagementServiceImpl(new DataAccessServiceImpl(),
new MsoBusinessLogicImpl(new MsoRestClientNew()));
}
@Test
public void testGetMSOChangeManagements() throws Exception {
ChangeManagementServiceImpl testSubject;
Collection<Request> result;
// default test
testSubject = createTestSubject();
result = testSubject.getMSOChangeManagements();
}
@Test
public void testDoChangeManagement() throws Exception {
ChangeManagementServiceImpl testSubject;
ChangeManagementRequest request = null;
String vnfName = "";
ResponseEntity<String> result;
// test 1
testSubject = createTestSubject();
request = null;
result = testSubject.doChangeManagement(request, vnfName);
Assert.assertEquals(null, result);
}
@Test
public void testGetSchedulerChangeManagements() throws Exception {
ChangeManagementServiceImpl testSubject;
JSONArray result;
// default test
testSubject = createTestSubject();
result = testSubject.getSchedulerChangeManagements();
}
@Test
public void testDeleteSchedule() throws Exception {
ChangeManagementServiceImpl testSubject;
String scheduleId = "";
// default test
testSubject = createTestSubject();
testSubject.deleteSchedule(scheduleId);
}
@Test
public void testAddVnfWorkflowRelation() throws Exception {
ChangeManagementServiceImpl testSubject;
VnfWorkflowRelationRequest vnfWorkflowRelationRequest = null;
VnfWorkflowRelationResponse result;
// default test
try {
testSubject = createTestSubject();
result = testSubject.addVnfWorkflowRelation(vnfWorkflowRelationRequest);
} catch (
Exception e) {
}
}
@Test
public void testDeleteVnfWorkflowRelation() throws Exception {
ChangeManagementServiceImpl testSubject;
VnfWorkflowRelationRequest vnfWorkflowRelationRequest = null;
VnfWorkflowRelationResponse result;
// default test
try {
testSubject = createTestSubject();
result = testSubject.deleteVnfWorkflowRelation(vnfWorkflowRelationRequest);
} catch (
Exception e) {
}
}
@Test
public void testGetAllVnfWorkflowRelations() throws Exception {
ChangeManagementServiceImpl testSubject;
VnfWorkflowRelationAllResponse result;
// default test
try {
testSubject = createTestSubject();
result = testSubject.getAllVnfWorkflowRelations();
} catch (
Exception e) {
}
}
@Test
public void testGetWorkflowsForVnf() throws Exception {
ChangeManagementServiceImpl testSubject;
GetVnfWorkflowRelationRequest getVnfWorkflowRelationRequest = null;
List<String> result;
// default test
try {
testSubject = createTestSubject();
result = testSubject.getWorkflowsForVnf(getVnfWorkflowRelationRequest);
} catch (
Exception e) {
}
}
@Test
public void testUploadConfigUpdateFile() throws Exception {
ChangeManagementServiceImpl testSubject;
MultipartFile file = null;
String result;
// default test
try {
testSubject = createTestSubject();
result = testSubject.uploadConfigUpdateFile(file);
} catch (
Exception e) {
}
}
/*
* TODO: fix private ChangeManagementServiceImpl createTestSubject() {
* return new ChangeManagementServiceImpl(); }
*/
/*
* @Test public void testGetMSOChangeManagements() throws Exception {
* ChangeManagementServiceImpl testSubject; Collection<Request> result;
*
* // default test testSubject = createTestSubject(); result =
* testSubject.getMSOChangeManagements(); }
*
*
* @Test public void testFindRequestByVnfName() throws Exception {
* ChangeManagementServiceImpl testSubject;List<RequestDetails> requests =
* null; String vnfName = ""; RequestDetails result;
*
* // test 1 testSubject=createTestSubject();requests = null;
* result=Deencapsulation.invoke(testSubject, "findRequestByVnfName", new
* Object[]{List<RequestDetails>.class, vnfName}); Assert.assertEquals(null,
* result); }
*/
/*
*
* @Test public void testDoChangeManagement() throws Exception {
* ChangeManagementServiceImpl testSubject; ChangeManagementRequest request
* = null; String vnfName = ""; ResponseEntity<String> result;
*
* // test 1 testSubject = createTestSubject(); request = null; result =
* testSubject.doChangeManagement(request, vnfName);
* Assert.assertEquals(null, result); }
*
*
* @Test public void testGetSchedulerChangeManagements() throws Exception {
* ChangeManagementServiceImpl testSubject; JSONArray result;
*
* // default test testSubject = createTestSubject(); result =
* testSubject.getSchedulerChangeManagements(); }
*/
}
|