2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 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.onap.appc.dg;
24 import static org.junit.Assert.*;
26 import java.util.HashMap;
29 import org.junit.Before;
30 import org.junit.Test;
31 import org.mockito.Mockito;
32 import org.onap.appc.dg.mock.instance.MockAaiResource;
33 import org.onap.appc.dg.mock.instance.MockConfigureNodeExecutor;
34 import org.onap.appc.dg.mock.instance.MockSvcLogicJavaPlugin;
35 import org.osgi.framework.BundleContext;
36 import org.osgi.framework.FrameworkUtil;
37 import org.powermock.api.mockito.PowerMockito;
38 import org.slf4j.Logger;
39 import org.slf4j.LoggerFactory;
41 import com.att.eelf.configuration.EELFLogger;
42 import com.att.eelf.configuration.EELFManager;
43 /* move to open source
44 import org.apache.sling.testing.mock.osgi.MockOsgi;
45 import com.att.sdnctl.dgtestlibrary.AbstractDGTestCase;
46 import com.att.sdnctl.dgtestlibrary.DGTestCase;
47 import com.att.sdnctl.dgtestlibrary.GraphKey;
49 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
50 import org.onap.ccsdk.sli.core.sli.provider.ExecuteNodeExecutor;
51 import org.onap.ccsdk.sli.core.sli.provider.SvcLogicAdaptorFactory;
54 public class TestUpdateAaiInfo /* extends AbstractDGTestCase */ {
55 //private final static Logger logger = LoggerFactory.getLogger(TestGetParams.class);
56 private static final EELFLogger logger = EELFManager.getInstance().getLogger(TestUpdateAaiInfo.class);
57 public static String UpdateAaiInfoXML = "src/main/resources/xml/APPC_UpdateAaiInfo.xml";
62 public void testUpdateAaiInfoSuccess() {
65 String propertyfileName = "APPC/UpdateAaiInfo/Update_Success.properties";
66 Map<String, Object> serviceReferences = new HashMap<String, Object>();
68 // Register Call graphs
69 String injectGraphXmls[] = new String[] { UpdateAaiInfoXML };
72 Map<String, Object> resourceReferences = new HashMap<String, Object>();
75 resourceReferences.put("org.openecomp.sdnc.sli.aai.AAIService", new MockAaiResource());
77 GraphKey graphKey = new GraphKey("APPC", null, "UpdateAaiInfo", null);
78 DGTestCase tc = new DGTestCase(graphKey);
79 tc.setInjectGraphXmls(injectGraphXmls);
80 tc.setServiceReferences(serviceReferences);
81 tc.setPropertyfileName(propertyfileName);
82 tc.setResourceReferences(resourceReferences);
84 SvcLogicContext ctx = new SvcLogicContext();
85 processTestCase(tc, ctx);
88 } catch (Exception e) {
97 public void testUpdateAaiInfoFail() {
100 String propertyfileName = "APPC/UpdateAaiInfo/Update_Fail.properties";
101 Map<String, Object> serviceReferences = new HashMap<String, Object>();
105 // Register Call graphs
106 String injectGraphXmls[] = new String[] { UpdateAaiInfoXML };
109 GraphKey graphKey = new GraphKey("APPC", null, "UpdateAaiInfo", null);
110 DGTestCase tc = new DGTestCase(graphKey);
111 tc.setInjectGraphXmls(injectGraphXmls);
112 tc.setServiceReferences(serviceReferences);
113 tc.setPropertyfileName(propertyfileName);
116 Map<String, Object> resourceReferences = new HashMap<String, Object>();
117 tc.setResourceReferences(resourceReferences);
119 SvcLogicContext ctx = new SvcLogicContext();
120 processTestCase(tc, ctx);
124 } catch (Exception e) {
133 public void testGetVnfcRefFail() {
136 String propertyfileName = "APPC/UpdateAaiInfo/GetVnfcRef_Fail.properties";
137 Map<String, Object> serviceReferences = new HashMap<String, Object>();
141 // Register Call graphs
142 String injectGraphXmls[] = new String[] { UpdateAaiInfoXML };
145 GraphKey graphKey = new GraphKey("APPC", null, "UpdateAaiInfo", null);
146 DGTestCase tc = new DGTestCase(graphKey);
147 tc.setInjectGraphXmls(injectGraphXmls);
148 tc.setServiceReferences(serviceReferences);
149 tc.setPropertyfileName(propertyfileName);
151 Map<String, Object> resourceReferences = new HashMap<String, Object>();
152 tc.setResourceReferences(resourceReferences);
154 SvcLogicContext ctx = new SvcLogicContext();
155 processTestCase(tc, ctx);
159 } catch (Exception e) {