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.ResourceImportManager;
32 import org.openecomp.sdc.be.impl.ComponentsUtils;
33 import org.openecomp.sdc.be.impl.ServletUtils;
34 import org.openecomp.sdc.be.model.PropertyDefinition;
35 import org.openecomp.sdc.be.user.UserBusinessLogic;
36 import org.openecomp.sdc.exception.ResponseFormat;
38 import com.google.common.base.Equivalence.Wrapper;
40 public class AttributeServletTest {
42 private AttributeServlet createTestSubject() {
43 UserBusinessLogic userBusinessLogic = mock(UserBusinessLogic.class);
44 ComponentInstanceBusinessLogic componentInstanceBL = mock(ComponentInstanceBusinessLogic.class);
45 ComponentsUtils componentsUtils = mock(ComponentsUtils.class);
46 ServletUtils servletUtils = mock(ServletUtils.class);
47 ResourceImportManager resourceImportManager = mock(ResourceImportManager.class);
49 return new AttributeServlet(userBusinessLogic, componentInstanceBL, componentsUtils, servletUtils,
50 resourceImportManager);
55 public void testCreateAttribute() throws Exception {
56 AttributeServlet testSubject;
57 String resourceId = "";
59 HttpServletRequest request = null;
64 testSubject = createTestSubject();
69 public void testUpdateAttribute() throws Exception {
70 AttributeServlet testSubject;
71 String resourceId = "";
72 String attributeId = "";
74 HttpServletRequest request = null;
79 testSubject = createTestSubject();
84 public void testDeleteAttribute() throws Exception {
85 AttributeServlet testSubject;
86 String resourceId = "";
87 String attributeId = "";
88 HttpServletRequest request = null;
93 testSubject = createTestSubject();
98 public void testBuildAttributeFromString() throws Exception {
99 AttributeServlet testSubject;String data = "";
100 Wrapper<PropertyDefinition> attributesWrapper = null;
101 Wrapper<ResponseFormat> errorWrapper = null;