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.http.HttpServletRequest;
26 import javax.ws.rs.core.Response;
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.ProductBusinessLogic;
32 import org.openecomp.sdc.be.impl.ComponentsUtils;
33 import org.openecomp.sdc.be.user.UserBusinessLogic;
35 public class ProductServletTest {
37 private ProductServlet createTestSubject() {
38 UserBusinessLogic userBusinessLogic = mock(UserBusinessLogic.class);
39 ProductBusinessLogic productBusinessLogic = mock(ProductBusinessLogic.class);
40 ComponentsUtils componentsUtils = mock(ComponentsUtils.class);
42 return new ProductServlet(userBusinessLogic, productBusinessLogic, componentsUtils);
47 public void testCreateProduct() throws Exception {
48 ProductServlet testSubject;
50 HttpServletRequest request = null;
55 testSubject = createTestSubject();
60 public void testGetProductById() throws Exception {
61 ProductServlet testSubject;
62 String productId = "";
63 HttpServletRequest request = null;
68 testSubject = createTestSubject();
73 public void testGetServiceByNameAndVersion() throws Exception {
74 ProductServlet testSubject;
75 String productName = "";
76 String productVersion = "";
77 HttpServletRequest request = null;
82 testSubject = createTestSubject();
87 public void testDeleteProduct() throws Exception {
88 ProductServlet testSubject;
89 String productId = "";
90 HttpServletRequest request = null;
94 testSubject = createTestSubject();
99 public void testUpdateProductMetadata() throws Exception {
100 ProductServlet testSubject;
101 String productId = "";
103 HttpServletRequest request = null;
108 testSubject = createTestSubject();
113 public void testValidateServiceName() throws Exception {
114 ProductServlet testSubject;
115 String productName = "";
116 HttpServletRequest request = null;
121 testSubject = createTestSubject();