2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.sdc.be.servlets;
23 import org.junit.Test;
24 import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic;
25 import org.openecomp.sdc.be.impl.ComponentsUtils;
26 import org.openecomp.sdc.be.user.UserBusinessLogic;
28 import javax.servlet.http.HttpServletRequest;
29 import javax.ws.rs.core.Response;
31 import static org.mockito.Mockito.mock;
34 public class ArtifactServletTest {
36 private ArtifactServlet createTestSubject() {
37 UserBusinessLogic userBusinessLogic = mock(UserBusinessLogic.class);
38 ComponentsUtils componentsUtils = mock(ComponentsUtils.class);
39 ArtifactsBusinessLogic artifactsBusinessLogic = mock(ArtifactsBusinessLogic.class);
40 return new ArtifactServlet(userBusinessLogic, componentsUtils,artifactsBusinessLogic);
45 public void testLoadArtifact() throws Exception {
46 ArtifactServlet testSubject;
47 String resourceId = "";
49 HttpServletRequest request = null;
53 testSubject = createTestSubject();
59 public void testUpdateArtifact() throws Exception {
60 ArtifactServlet testSubject;
61 String resourceId = "";
62 String artifactId = "";
64 HttpServletRequest request = null;
68 testSubject = createTestSubject();
74 public void testDeleteArtifact() throws Exception {
75 ArtifactServlet testSubject;
76 String resourceId = "";
77 String artifactId = "";
78 HttpServletRequest request = null;
82 testSubject = createTestSubject();
88 public void testLoadInformationArtifact() throws Exception {
89 ArtifactServlet testSubject;
90 String serviceId = "";
92 HttpServletRequest request = null;
96 testSubject = createTestSubject();
102 public void testUpdateInformationArtifact() throws Exception {
103 ArtifactServlet testSubject;
104 String serviceId = "";
105 String artifactId = "";
107 HttpServletRequest request = null;
111 testSubject = createTestSubject();
117 public void testUpdateApiArtifact() throws Exception {
118 ArtifactServlet testSubject;
119 String serviceId = "";
120 String artifactId = "";
122 HttpServletRequest request = null;
128 testSubject = createTestSubject();
134 public void testDeleteApiArtifact() throws Exception {
135 ArtifactServlet testSubject;
136 String serviceId = "";
137 String artifactId = "";
138 HttpServletRequest request = null;
144 testSubject = createTestSubject();
150 public void testDeleteInformationalArtifact() throws Exception {
151 ArtifactServlet testSubject;
152 String serviceId = "";
153 String artifactId = "";
154 HttpServletRequest request = null;
158 testSubject = createTestSubject();
164 public void testDownloadServiceArtifactBase64() throws Exception {
165 ArtifactServlet testSubject;
166 String serviceId = "";
167 String artifactId = "";
168 HttpServletRequest request = null;
172 testSubject = createTestSubject();
178 public void testDownloadResourceArtifactBase64() throws Exception {
179 ArtifactServlet testSubject;
180 String resourceId = "";
181 String artifactId = "";
182 HttpServletRequest request = null;
186 testSubject = createTestSubject();
192 public void testDownloadResourceInstanceArtifactBase64() throws Exception {
193 ArtifactServlet testSubject;
194 String containerComponentType = "";
195 String componentId = "";
196 String componentInstanceId = "";
197 String artifactId = "";
198 HttpServletRequest request = null;
202 testSubject = createTestSubject();
208 public void testLoadArtifactToInterface() throws Exception {
209 ArtifactServlet testSubject;
210 String resourceId = "";
211 String interfaceType = "";
212 String operation = "";
216 HttpServletRequest request = null;
220 testSubject = createTestSubject();
226 public void testDeleteArtifactToInterface() throws Exception {
227 ArtifactServlet testSubject;
228 String resourceId = "";
229 String interfaceType = "";
230 String operation = "";
231 String artifactId = "";
232 HttpServletRequest request = null;
236 testSubject = createTestSubject();
242 public void testUpdateArtifactToInterface() throws Exception {
243 ArtifactServlet testSubject;
244 String resourceId = "";
245 String interfaceType = "";
246 String operation = "";
247 String artifactId = "";
250 HttpServletRequest request = null;
255 testSubject = createTestSubject();
261 public void testUpdateRIArtifact() throws Exception {
262 ArtifactServlet testSubject;
263 String containerComponentType = "";
264 String componentId = "";
265 String componentInstanceId = "";
266 String artifactId = "";
268 HttpServletRequest request = null;
272 testSubject = createTestSubject();
278 public void testUpdateComponentInstanceArtifact() throws Exception {
279 ArtifactServlet testSubject;
282 String containerComponentType = "";
283 String componentId = "";
284 String componentInstanceId = "";
285 String artifactId = "";
287 HttpServletRequest request = null;
291 testSubject = createTestSubject();
297 public void testLoadComponentInstanceArtifact() throws Exception {
298 ArtifactServlet testSubject;
301 String containerComponentType = "";
302 String componentId = "";
303 String componentInstanceId = "";
305 HttpServletRequest request = null;
309 testSubject = createTestSubject();
315 public void testDeleteComponentInstanceArtifact() throws Exception {
316 ArtifactServlet testSubject;
319 String containerComponentType = "";
320 String componentId = "";
321 String componentInstanceId = "";
322 String artifactId = "";
324 HttpServletRequest request = null;
328 testSubject = createTestSubject();
334 public void testGetComponentArtifacts() throws Exception {
335 ArtifactServlet testSubject;
336 String containerComponentType = "";
337 String componentId = "";
338 String artifactGroupType = "";
339 HttpServletRequest request = null;
343 testSubject = createTestSubject();
349 public void testGetComponentInstanceArtifacts() throws Exception {
350 ArtifactServlet testSubject;
351 String containerComponentType = "";
352 String componentId = "";
353 String componentInstanceId = "";
354 String artifactGroupType = "";
355 HttpServletRequest request = null;
359 testSubject = createTestSubject();