CSIT Fix for SDC-2585
[sdc.git] / catalog-be / src / test / java / org / openecomp / sdc / be / servlets / CsarBuildServletTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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=========================================================
19  */
20
21 package org.openecomp.sdc.be.servlets;
22
23 import static org.mockito.Mockito.mock;
24
25 import javax.servlet.http.HttpServletRequest;
26 import javax.ws.rs.core.Response;
27
28 import org.junit.Test;
29 import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic;
30 import org.openecomp.sdc.be.components.impl.GroupBusinessLogic;
31 import org.openecomp.sdc.be.components.impl.ResourceImportManager;
32 import org.openecomp.sdc.be.impl.ComponentsUtils;
33 import org.openecomp.sdc.be.impl.DownloadArtifactLogic;
34 import org.openecomp.sdc.be.impl.ServletUtils;
35 import org.openecomp.sdc.be.resources.api.IResourceUploader;
36 import org.openecomp.sdc.be.user.UserBusinessLogic;
37
38
39 public class CsarBuildServletTest {
40
41         private CsarBuildServlet createTestSubject() {
42                 UserBusinessLogic userBusinessLogic = mock(UserBusinessLogic.class);
43                 ComponentsUtils componentsUtils = mock(ComponentsUtils.class);
44                 IResourceUploader resourceUploader = mock(IResourceUploader.class);
45                 DownloadArtifactLogic logic = mock(DownloadArtifactLogic.class);
46
47                 return new CsarBuildServlet(userBusinessLogic, componentsUtils, resourceUploader,
48                         logic);
49         }
50
51         
52         @Test
53         public void testGetDefaultTemplate() throws Exception {
54                 CsarBuildServlet testSubject;
55                 HttpServletRequest request = null;
56                 String serviceName = "";
57                 String serviceVersion = "";
58                 Response result;
59
60                 // default test
61                 testSubject = createTestSubject();
62                 result = testSubject.getDefaultTemplate(request, serviceName, serviceVersion);
63         }
64
65         
66         @Test
67         public void testGetToscaCsarTemplate() throws Exception {
68                 CsarBuildServlet testSubject;
69                 HttpServletRequest request = null;
70                 String serviceName = "";
71                 String serviceVersion = "";
72                 Response result;
73
74                 // default test
75                 testSubject = createTestSubject();
76                 result = testSubject.getToscaCsarTemplate(request, serviceName, serviceVersion);
77         }
78
79         
80
81 }