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 static org.mockito.Mockito.mock;
25 import javax.servlet.http.HttpServletRequest;
26 import javax.ws.rs.core.Response;
28 import org.junit.Test;
29 import org.openecomp.sdc.be.components.impl.ArtifactsBusinessLogic;
30 import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic;
31 import org.openecomp.sdc.be.components.impl.ConsumerBusinessLogic;
32 import org.openecomp.sdc.be.components.impl.GroupBusinessLogic;
33 import org.openecomp.sdc.be.impl.ComponentsUtils;
34 import org.openecomp.sdc.be.user.UserBusinessLogic;
37 public class ArtifactServletTest {
39 private ArtifactServlet createTestSubject() {
40 UserBusinessLogic userBusinessLogic = mock(UserBusinessLogic.class);
41 ComponentsUtils componentsUtils = mock(ComponentsUtils.class);
42 ArtifactsBusinessLogic artifactsBusinessLogic = mock(ArtifactsBusinessLogic.class);
43 return new ArtifactServlet(userBusinessLogic, componentsUtils,artifactsBusinessLogic);
48 public void testLoadArtifact() throws Exception {
49 ArtifactServlet testSubject;
50 String resourceId = "";
52 HttpServletRequest request = null;
56 testSubject = createTestSubject();
62 public void testUpdateArtifact() throws Exception {
63 ArtifactServlet testSubject;
64 String resourceId = "";
65 String artifactId = "";
67 HttpServletRequest request = null;
71 testSubject = createTestSubject();
77 public void testDeleteArtifact() throws Exception {
78 ArtifactServlet testSubject;
79 String resourceId = "";
80 String artifactId = "";
81 HttpServletRequest request = null;
85 testSubject = createTestSubject();
91 public void testLoadInformationArtifact() throws Exception {
92 ArtifactServlet testSubject;
93 String serviceId = "";
95 HttpServletRequest request = null;
99 testSubject = createTestSubject();
105 public void testUpdateInformationArtifact() throws Exception {
106 ArtifactServlet testSubject;
107 String serviceId = "";
108 String artifactId = "";
110 HttpServletRequest request = null;
114 testSubject = createTestSubject();
120 public void testUpdateApiArtifact() throws Exception {
121 ArtifactServlet testSubject;
122 String serviceId = "";
123 String artifactId = "";
125 HttpServletRequest request = null;
131 testSubject = createTestSubject();
137 public void testDeleteApiArtifact() throws Exception {
138 ArtifactServlet testSubject;
139 String serviceId = "";
140 String artifactId = "";
141 HttpServletRequest request = null;
147 testSubject = createTestSubject();
153 public void testDeleteInformationalArtifact() throws Exception {
154 ArtifactServlet testSubject;
155 String serviceId = "";
156 String artifactId = "";
157 HttpServletRequest request = null;
161 testSubject = createTestSubject();
167 public void testDownloadServiceArtifactBase64() throws Exception {
168 ArtifactServlet testSubject;
169 String serviceId = "";
170 String artifactId = "";
171 HttpServletRequest request = null;
175 testSubject = createTestSubject();
181 public void testDownloadResourceArtifactBase64() throws Exception {
182 ArtifactServlet testSubject;
183 String resourceId = "";
184 String artifactId = "";
185 HttpServletRequest request = null;
189 testSubject = createTestSubject();
195 public void testDownloadResourceInstanceArtifactBase64() throws Exception {
196 ArtifactServlet testSubject;
197 String containerComponentType = "";
198 String componentId = "";
199 String componentInstanceId = "";
200 String artifactId = "";
201 HttpServletRequest request = null;
205 testSubject = createTestSubject();
211 public void testLoadArtifactToInterface() throws Exception {
212 ArtifactServlet testSubject;
213 String resourceId = "";
214 String interfaceType = "";
215 String operation = "";
219 HttpServletRequest request = null;
223 testSubject = createTestSubject();
229 public void testDeleteArtifactToInterface() throws Exception {
230 ArtifactServlet testSubject;
231 String resourceId = "";
232 String interfaceType = "";
233 String operation = "";
234 String artifactId = "";
235 HttpServletRequest request = null;
239 testSubject = createTestSubject();
245 public void testUpdateArtifactToInterface() throws Exception {
246 ArtifactServlet testSubject;
247 String resourceId = "";
248 String interfaceType = "";
249 String operation = "";
250 String artifactId = "";
253 HttpServletRequest request = null;
258 testSubject = createTestSubject();
264 public void testUpdateRIArtifact() throws Exception {
265 ArtifactServlet testSubject;
266 String containerComponentType = "";
267 String componentId = "";
268 String componentInstanceId = "";
269 String artifactId = "";
271 HttpServletRequest request = null;
275 testSubject = createTestSubject();
281 public void testUpdateComponentInstanceArtifact() throws Exception {
282 ArtifactServlet testSubject;
285 String containerComponentType = "";
286 String componentId = "";
287 String componentInstanceId = "";
288 String artifactId = "";
290 HttpServletRequest request = null;
294 testSubject = createTestSubject();
300 public void testLoadComponentInstanceArtifact() throws Exception {
301 ArtifactServlet testSubject;
304 String containerComponentType = "";
305 String componentId = "";
306 String componentInstanceId = "";
308 HttpServletRequest request = null;
312 testSubject = createTestSubject();
318 public void testDeleteComponentInstanceArtifact() throws Exception {
319 ArtifactServlet testSubject;
322 String containerComponentType = "";
323 String componentId = "";
324 String componentInstanceId = "";
325 String artifactId = "";
327 HttpServletRequest request = null;
331 testSubject = createTestSubject();
337 public void testGetComponentArtifacts() throws Exception {
338 ArtifactServlet testSubject;
339 String containerComponentType = "";
340 String componentId = "";
341 String artifactGroupType = "";
342 HttpServletRequest request = null;
346 testSubject = createTestSubject();
352 public void testGetComponentInstanceArtifacts() throws Exception {
353 ArtifactServlet testSubject;
354 String containerComponentType = "";
355 String componentId = "";
356 String componentInstanceId = "";
357 String artifactGroupType = "";
358 HttpServletRequest request = null;
362 testSubject = createTestSubject();