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.ServletContext;
26 import javax.servlet.http.HttpServletRequest;
27 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.CapabilitiesBusinessLogic;
31 import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic;
32 import org.openecomp.sdc.be.components.impl.InterfaceOperationBusinessLogic;
33 import org.openecomp.sdc.be.components.impl.PropertyBusinessLogic;
34 import org.openecomp.sdc.be.components.impl.RelationshipTypeBusinessLogic;
35 import org.openecomp.sdc.be.components.impl.ResourceBusinessLogic;
36 import org.openecomp.sdc.be.components.impl.ResourceImportManager;
37 import org.openecomp.sdc.be.impl.ComponentsUtils;
38 import org.openecomp.sdc.be.impl.ServletUtils;
39 import org.openecomp.sdc.be.user.UserBusinessLogic;
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);
54 ArtifactsBusinessLogic artifactsBusinessLogic = mock(ArtifactsBusinessLogic.class);
56 return new TypesFetchServlet(userBusinessLogic, componentInstanceBL, componentsUtils, servletUtils,
57 resourceImportManager, propertyBusinessLogic, relationshipTypeBusinessLogic, capabilitiesBusinessLogic,
58 interfaceOperationBusinessLogic, resourceBusinessLogic, artifactsBusinessLogic);
63 public void testGetAllDataTypesServlet() throws Exception {
64 TypesFetchServlet testSubject;
65 HttpServletRequest request = null;
70 testSubject = createTestSubject();
75 public void testGetPropertyBL() throws Exception {
76 TypesFetchServlet testSubject;
77 ServletContext context = null;
78 PropertyBusinessLogic result;
81 testSubject = createTestSubject();