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.CapabilitiesBusinessLogic;
25 import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic;
26 import org.openecomp.sdc.be.components.impl.InterfaceOperationBusinessLogic;
27 import org.openecomp.sdc.be.components.impl.PropertyBusinessLogic;
28 import org.openecomp.sdc.be.components.impl.RelationshipTypeBusinessLogic;
29 import org.openecomp.sdc.be.components.impl.ResourceBusinessLogic;
30 import org.openecomp.sdc.be.components.impl.ResourceImportManager;
31 import org.openecomp.sdc.be.impl.ComponentsUtils;
32 import org.openecomp.sdc.be.impl.ServletUtils;
33 import org.openecomp.sdc.be.user.UserBusinessLogic;
35 import javax.servlet.ServletContext;
36 import javax.servlet.http.HttpServletRequest;
37 import javax.ws.rs.core.Response;
39 import static org.mockito.Mockito.mock;
41 public class TypesFetchServletTest {
43 private TypesFetchServlet createTestSubject() {
44 UserBusinessLogic userBusinessLogic = mock(UserBusinessLogic.class);
45 ComponentInstanceBusinessLogic componentInstanceBL = mock(ComponentInstanceBusinessLogic.class);
46 ComponentsUtils componentsUtils = mock(ComponentsUtils.class);
47 ServletUtils servletUtils = mock(ServletUtils.class);
48 ResourceImportManager resourceImportManager = mock(ResourceImportManager.class);
49 PropertyBusinessLogic propertyBusinessLogic = mock(PropertyBusinessLogic.class);
50 RelationshipTypeBusinessLogic relationshipTypeBusinessLogic = mock(RelationshipTypeBusinessLogic.class);
51 CapabilitiesBusinessLogic capabilitiesBusinessLogic = mock(CapabilitiesBusinessLogic.class);
52 InterfaceOperationBusinessLogic interfaceOperationBusinessLogic = mock(InterfaceOperationBusinessLogic.class);
53 ResourceBusinessLogic resourceBusinessLogic = mock(ResourceBusinessLogic.class);
55 return new TypesFetchServlet(userBusinessLogic, componentInstanceBL, componentsUtils, servletUtils,
56 resourceImportManager, propertyBusinessLogic, relationshipTypeBusinessLogic, capabilitiesBusinessLogic,
57 interfaceOperationBusinessLogic, resourceBusinessLogic);
62 public void testGetAllDataTypesServlet() throws Exception {
63 TypesFetchServlet testSubject;
64 HttpServletRequest request = null;
69 testSubject = createTestSubject();
74 public void testGetPropertyBL() throws Exception {
75 TypesFetchServlet testSubject;
76 ServletContext context = null;
77 PropertyBusinessLogic result;
80 testSubject = createTestSubject();