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;
29 import org.junit.Test;
30 import org.openecomp.sdc.be.components.impl.*;
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 public class TypesFetchServletTest {
37 private TypesFetchServlet createTestSubject() {
38 UserBusinessLogic userBusinessLogic = mock(UserBusinessLogic.class);
39 ComponentInstanceBusinessLogic componentInstanceBL = mock(ComponentInstanceBusinessLogic.class);
40 ComponentsUtils componentsUtils = mock(ComponentsUtils.class);
41 ServletUtils servletUtils = mock(ServletUtils.class);
42 ResourceImportManager resourceImportManager = mock(ResourceImportManager.class);
43 PropertyBusinessLogic propertyBusinessLogic = mock(PropertyBusinessLogic.class);
44 RelationshipTypeBusinessLogic relationshipTypeBusinessLogic = mock(RelationshipTypeBusinessLogic.class);
45 CapabilitiesBusinessLogic capabilitiesBusinessLogic = mock(CapabilitiesBusinessLogic.class);
46 InterfaceOperationBusinessLogic interfaceOperationBusinessLogic = mock(InterfaceOperationBusinessLogic.class);
47 ResourceBusinessLogic resourceBusinessLogic = mock(ResourceBusinessLogic.class);
49 return new TypesFetchServlet(userBusinessLogic, componentInstanceBL, componentsUtils, servletUtils,
50 resourceImportManager, propertyBusinessLogic, relationshipTypeBusinessLogic, capabilitiesBusinessLogic,
51 interfaceOperationBusinessLogic, resourceBusinessLogic);
56 public void testGetAllDataTypesServlet() throws Exception {
57 TypesFetchServlet testSubject;
58 HttpServletRequest request = null;
63 testSubject = createTestSubject();
68 public void testGetPropertyBL() throws Exception {
69 TypesFetchServlet testSubject;
70 ServletContext context = null;
71 PropertyBusinessLogic result;
74 testSubject = createTestSubject();