aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/test/java/org/onap/vid/controllers/ChangeManagementControllerTest.java
blob: 58406a662107bda6d9edc8c9a06f26d898a3ac3b (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
package org.onap.vid.controllers;

import org.json.simple.JSONArray;
import org.junit.Test;
import org.onap.vid.changeManagement.ChangeManagementRequest;
import org.onap.vid.changeManagement.GetVnfWorkflowRelationRequest;
import org.onap.vid.changeManagement.VnfWorkflowRelationRequest;
import org.onap.vid.mso.MsoResponseWrapperInterface;
import org.onap.vid.services.ChangeManagementServiceImpl;
import org.onap.vid.services.WorkflowServiceImpl;
import org.springframework.http.ResponseEntity;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.util.Collection;

public class ChangeManagementControllerTest {

    private ChangeManagementController createTestSubject() {
        return new ChangeManagementController(new WorkflowServiceImpl(), new ChangeManagementServiceImpl(null, null, null),
                null);
    }

    @Test
    public void testGetWorkflow() throws Exception {
        ChangeManagementController testSubject;
        Collection<String> vnfs = null;
        ResponseEntity<Collection<String>> result;

        // default test
        testSubject = createTestSubject();
        try {
            result = testSubject.getWorkflow(vnfs);
        } catch (

        Exception e) {
        }
    }

    @Test
    public void testGetMSOChangeManagements() throws Exception {
        ChangeManagementController testSubject;

        // default test
        testSubject = createTestSubject();
        try {
            testSubject.getMSOChangeManagements();
        } catch (

        Exception e) {
        }
    }

    @Test
    public void testChangeManagement() throws Exception {
        ChangeManagementController testSubject;
        String vnfName = "";
        HttpServletRequest request = null;
        ChangeManagementRequest changeManagmentRequest = null;
        ResponseEntity<String> result;

        // default test
        testSubject = createTestSubject();
        result = testSubject.changeManagement(vnfName, request, changeManagmentRequest);
    }

    @Test
    public void testUploadConfigUpdateFile() throws Exception {
        ChangeManagementController testSubject;
        MultipartFile file = null;
        ResponseEntity result;

        // default test
        testSubject = createTestSubject();
        result = testSubject.uploadConfigUpdateFile(file);
    }

    @Test
    public void testGetSchedulerChangeManagements() throws Exception {
        ChangeManagementController testSubject;
        ResponseEntity<JSONArray> result;

        // default test
        testSubject = createTestSubject();
        result = testSubject.getSchedulerChangeManagements();
    }

    @Test
    public void testDeleteSchedule() throws Exception {
        ChangeManagementController testSubject;
        String scheduleId = "";
        ResponseEntity result;

        // default test
        testSubject = createTestSubject();
        result = testSubject.deleteSchedule(scheduleId);
    }

    @Test
    public void testGetWorkflows() throws Exception {
        ChangeManagementController testSubject;
        GetVnfWorkflowRelationRequest getVnfWorkflowRelationRequest = null;
        ResponseEntity result;

        // default test
        testSubject = createTestSubject();
        result = testSubject.getWorkflows(getVnfWorkflowRelationRequest);
    }

    @Test
    public void testCreateWorkflowRelation() throws Exception {
        ChangeManagementController testSubject;
        VnfWorkflowRelationRequest vnfWorkflowRelationRequest = null;
        ResponseEntity result;

        // default test
        testSubject = createTestSubject();
        result = testSubject.createWorkflowRelation(vnfWorkflowRelationRequest);
    }

    @Test
    public void testGetAllWorkflowRelation() throws Exception {
        ChangeManagementController testSubject;
        ResponseEntity result;

        // default test
        testSubject = createTestSubject();
        result = testSubject.getAllWorkflowRelation();
    }

    @Test
    public void testDeleteWorkflowRelation() throws Exception {
        ChangeManagementController testSubject;
        VnfWorkflowRelationRequest vnfWorkflowRelationRequest = null;
        ResponseEntity result;

        // default test
        testSubject = createTestSubject();
        result = testSubject.deleteWorkflowRelation(vnfWorkflowRelationRequest);
    }

    @Test
    public void testClientDerivedExceptionAsBadRequest() throws Exception {
        ChangeManagementController testSubject;
        Exception e = null;
        MsoResponseWrapperInterface result;

        // default test
        try {
            testSubject = createTestSubject();
            result = testSubject.clientDerivedExceptionAsBadRequest(e);
        } catch (

        Exception ex) {
        }
    }
}