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 java.util.List;
27 import javax.servlet.http.HttpServletRequest;
28 import javax.ws.rs.core.Response;
30 import org.junit.Test;
31 import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic;
32 import org.openecomp.sdc.be.components.impl.ConsumerBusinessLogic;
33 import org.openecomp.sdc.be.components.impl.ElementBusinessLogic;
34 import org.openecomp.sdc.be.components.impl.GroupBusinessLogic;
35 import org.openecomp.sdc.be.components.scheduledtasks.ComponentsCleanBusinessLogic;
36 import org.openecomp.sdc.be.datatypes.enums.OriginTypeEnum;
37 import org.openecomp.sdc.be.impl.ComponentsUtils;
38 import org.openecomp.sdc.be.user.UserBusinessLogic;
40 public class ElementServletTest {
42 private ElementServlet createTestSubject() {
43 UserBusinessLogic userBusinessLogic = mock(UserBusinessLogic.class);
44 ComponentsUtils componentsUtils = mock(ComponentsUtils.class);
45 ComponentsCleanBusinessLogic componentsCleanBusinessLogic = mock(ComponentsCleanBusinessLogic.class);
46 ElementBusinessLogic elementBusinessLogic = mock(ElementBusinessLogic.class);
47 return new ElementServlet(userBusinessLogic, componentsUtils, componentsCleanBusinessLogic, elementBusinessLogic);
52 public void testGetComponentCategories() throws Exception {
53 ElementServlet testSubject;
54 String componentType = "";
56 HttpServletRequest request = null;
60 testSubject = createTestSubject();
66 public void testGetAllCategories() throws Exception {
67 ElementServlet testSubject;
68 HttpServletRequest request = null;
73 testSubject = createTestSubject();
79 public void testCreateComponentCategory() throws Exception {
80 ElementServlet testSubject;
81 String componentType = "";
83 HttpServletRequest request = null;
88 testSubject = createTestSubject();
94 public void testDeleteComponentCategory() throws Exception {
95 ElementServlet testSubject;
96 String categoryUniqueId = "";
97 String componentType = "";
98 HttpServletRequest request = null;
103 testSubject = createTestSubject();
109 public void testCreateComponentSubCategory() throws Exception {
110 ElementServlet testSubject;
111 String componentType = "";
112 String categoryId = "";
114 HttpServletRequest request = null;
119 testSubject = createTestSubject();
125 public void testDeleteComponentSubCategory() throws Exception {
126 ElementServlet testSubject;
127 String categoryUniqueId = "";
128 String subCategoryUniqueId = "";
129 String componentType = "";
130 HttpServletRequest request = null;
135 testSubject = createTestSubject();
141 public void testCreateComponentGrouping() throws Exception {
142 ElementServlet testSubject;
143 String componentType = "";
144 String grandParentCategoryId = "";
145 String parentSubCategoryId = "";
147 HttpServletRequest request = null;
152 testSubject = createTestSubject();
158 public void testDeleteComponentGrouping() throws Exception {
159 ElementServlet testSubject;
160 String grandParentCategoryUniqueId = "";
161 String parentSubCategoryUniqueId = "";
162 String groupingUniqueId = "";
163 String componentType = "";
164 HttpServletRequest request = null;
169 testSubject = createTestSubject();
175 public void testGetTags() throws Exception {
176 ElementServlet testSubject;
177 HttpServletRequest request = null;
182 testSubject = createTestSubject();
188 public void testGetPropertyScopes() throws Exception {
189 ElementServlet testSubject;
190 HttpServletRequest request = null;
195 testSubject = createTestSubject();
201 public void testGetArtifactTypes() throws Exception {
202 ElementServlet testSubject;
203 HttpServletRequest request = null;
208 testSubject = createTestSubject();
214 public void testGetConfiguration() throws Exception {
215 ElementServlet testSubject;
216 HttpServletRequest request = null;
221 testSubject = createTestSubject();
227 public void testGetFollowedResourcesServices() throws Exception {
228 ElementServlet testSubject;
229 HttpServletRequest request = null;
234 testSubject = createTestSubject();
240 public void testGetCatalogComponents() throws Exception {
241 ElementServlet testSubject;
242 HttpServletRequest request = null;
244 List<OriginTypeEnum> excludeTypes = null;
248 testSubject = createTestSubject();
254 public void testDeleteMarkedResources() throws Exception {
255 ElementServlet testSubject;
256 String componentType = "";
257 HttpServletRequest request = null;
261 testSubject = createTestSubject();
267 public void testGetListOfCsars() throws Exception {
268 ElementServlet testSubject;
269 HttpServletRequest request = null;
273 testSubject = createTestSubject();