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 com.google.common.base.Equivalence.Wrapper;
24 import org.junit.Test;
25 import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic;
26 import org.openecomp.sdc.be.components.impl.ResourceImportManager;
27 import org.openecomp.sdc.be.impl.ComponentsUtils;
28 import org.openecomp.sdc.be.impl.ServletUtils;
29 import org.openecomp.sdc.be.model.PropertyDefinition;
30 import org.openecomp.sdc.be.user.UserBusinessLogic;
31 import org.openecomp.sdc.exception.ResponseFormat;
33 import javax.servlet.http.HttpServletRequest;
34 import javax.ws.rs.core.Response;
36 import static org.mockito.Mockito.mock;
38 public class AttributeServletTest {
40 private AttributeServlet createTestSubject() {
41 UserBusinessLogic userBusinessLogic = mock(UserBusinessLogic.class);
42 ComponentInstanceBusinessLogic componentInstanceBL = mock(ComponentInstanceBusinessLogic.class);
43 ComponentsUtils componentsUtils = mock(ComponentsUtils.class);
44 ServletUtils servletUtils = mock(ServletUtils.class);
45 ResourceImportManager resourceImportManager = mock(ResourceImportManager.class);
47 return new AttributeServlet(userBusinessLogic, componentInstanceBL, componentsUtils, servletUtils,
48 resourceImportManager);
53 public void testCreateAttribute() throws Exception {
54 AttributeServlet testSubject;
55 String resourceId = "";
57 HttpServletRequest request = null;
62 testSubject = createTestSubject();
67 public void testUpdateAttribute() throws Exception {
68 AttributeServlet testSubject;
69 String resourceId = "";
70 String attributeId = "";
72 HttpServletRequest request = null;
77 testSubject = createTestSubject();
82 public void testDeleteAttribute() throws Exception {
83 AttributeServlet testSubject;
84 String resourceId = "";
85 String attributeId = "";
86 HttpServletRequest request = null;
91 testSubject = createTestSubject();
96 public void testBuildAttributeFromString() throws Exception {
97 AttributeServlet testSubject;String data = "";
98 Wrapper<PropertyDefinition> attributesWrapper = null;
99 Wrapper<ResponseFormat> errorWrapper = null;