2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Copyright (C) 2017 Amdocs
8 * =============================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
21 * ============LICENSE_END=========================================================
24 package org.onap.appc.dg;
27 import static org.junit.Assert.*;
29 import java.util.HashMap;
32 import org.junit.Before;
33 import org.junit.Test;
34 import org.mockito.Mockito;
35 import org.onap.appc.dg.mock.instance.MockAaiResource;
36 import org.onap.appc.dg.mock.instance.MockConfigureNodeExecutor;
37 import org.onap.appc.dg.mock.instance.MockSvcLogicJavaPlugin;
38 import org.osgi.framework.BundleContext;
39 import org.osgi.framework.FrameworkUtil;
40 import org.powermock.api.mockito.PowerMockito;
41 import org.slf4j.Logger;
42 import org.slf4j.LoggerFactory;
44 import com.att.eelf.configuration.EELFLogger;
45 import com.att.eelf.configuration.EELFManager;
46 /* move to open source
47 import org.apache.sling.testing.mock.osgi.MockOsgi;
48 import org.onap.sdnc.dgtestlibrary.AbstractDGTestCase;
49 import org.onap.sdnc.dgtestlibrary.DGTestCase;
50 import org.onap.sdnc.dgtestlibrary.GraphKey;
52 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
53 import org.onap.ccsdk.sli.core.sli.provider.SvcLogicAdaptorFactory;
56 public class TestUpdateAaiInfo /* extends AbstractDGTestCase */ {
57 //private final static Logger logger = LoggerFactory.getLogger(TestGetParams.class);
58 private static final EELFLogger logger = EELFManager.getInstance().getLogger(TestUpdateAaiInfo.class);
59 public static String UpdateAaiInfoXML = "src/main/resources/xml/APPC_UpdateAaiInfo.xml";
64 public void testUpdateAaiInfoSuccess() {
67 String propertyfileName = "APPC/UpdateAaiInfo/Update_Success.properties";
68 Map<String, Object> serviceReferences = new HashMap<String, Object>();
70 // Register Call graphs
71 String injectGraphXmls[] = new String[] { UpdateAaiInfoXML };
74 Map<String, Object> resourceReferences = new HashMap<String, Object>();
77 resourceReferences.put("org.openecomp.sdnc.sli.aai.AAIService", new MockAaiResource());
79 GraphKey graphKey = new GraphKey("APPC", null, "UpdateAaiInfo", null);
80 DGTestCase tc = new DGTestCase(graphKey);
81 tc.setInjectGraphXmls(injectGraphXmls);
82 tc.setServiceReferences(serviceReferences);
83 tc.setPropertyfileName(propertyfileName);
84 tc.setResourceReferences(resourceReferences);
86 SvcLogicContext ctx = new SvcLogicContext();
87 processTestCase(tc, ctx);
90 } catch (Exception e) {
99 public void testUpdateAaiInfoFail() {
102 String propertyfileName = "APPC/UpdateAaiInfo/Update_Fail.properties";
103 Map<String, Object> serviceReferences = new HashMap<String, Object>();
107 // Register Call graphs
108 String injectGraphXmls[] = new String[] { UpdateAaiInfoXML };
111 GraphKey graphKey = new GraphKey("APPC", null, "UpdateAaiInfo", null);
112 DGTestCase tc = new DGTestCase(graphKey);
113 tc.setInjectGraphXmls(injectGraphXmls);
114 tc.setServiceReferences(serviceReferences);
115 tc.setPropertyfileName(propertyfileName);
118 Map<String, Object> resourceReferences = new HashMap<String, Object>();
119 tc.setResourceReferences(resourceReferences);
121 SvcLogicContext ctx = new SvcLogicContext();
122 processTestCase(tc, ctx);
126 } catch (Exception e) {
135 public void testGetVnfcRefFail() {
138 String propertyfileName = "APPC/UpdateAaiInfo/GetVnfcRef_Fail.properties";
139 Map<String, Object> serviceReferences = new HashMap<String, Object>();
143 // Register Call graphs
144 String injectGraphXmls[] = new String[] { UpdateAaiInfoXML };
147 GraphKey graphKey = new GraphKey("APPC", null, "UpdateAaiInfo", null);
148 DGTestCase tc = new DGTestCase(graphKey);
149 tc.setInjectGraphXmls(injectGraphXmls);
150 tc.setServiceReferences(serviceReferences);
151 tc.setPropertyfileName(propertyfileName);
153 Map<String, Object> resourceReferences = new HashMap<String, Object>();
154 tc.setResourceReferences(resourceReferences);
156 SvcLogicContext ctx = new SvcLogicContext();
157 processTestCase(tc, ctx);
161 } catch (Exception e) {