2 * ============LICENSE_START=======================================================
\r
4 * ================================================================================
\r
5 * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
\r
6 * ================================================================================
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
18 * ============LICENSE_END=========================================================
\r
21 package org.openecomp.mso.adapters.vnf;
\r
23 import java.util.HashMap;
\r
24 import java.util.Map;
\r
25 import org.junit.Test;
\r
26 import org.openecomp.mso.adapters.vnf.MsoVnfAdapterAsyncImpl;
\r
27 import org.openecomp.mso.entity.MsoRequest;
\r
28 import org.openecomp.mso.openstack.beans.VnfRollback;
\r
30 public class MsoVnfAdapterAsyncImplTest {
\r
33 public void healthCheckVNFTest() {
\r
34 MsoVnfAdapterAsyncImpl instance = new MsoVnfAdapterAsyncImpl();
\r
35 instance.healthCheckA();
\r
39 public void createVNFTest() {
\r
40 MsoVnfAdapterAsyncImpl instance = new MsoVnfAdapterAsyncImpl();
\r
41 MsoRequest msoRequest = new MsoRequest();
\r
42 msoRequest.setRequestId("12345");
\r
43 msoRequest.setServiceInstanceId("12345");
\r
46 instance.createVnfA("mdt1", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "vSAMP12", "VFMOD",
\r
47 "volumeGroupHeatStackId|1", new HashMap<>(), Boolean.FALSE, Boolean.TRUE, "messageId",
\r
48 null, "http://org.openecomp.mso/notify/adapterNotify/updateVnfNotificationRequest");
\r
49 } catch (Exception e) {
\r
55 public void updateVnfTest() {
\r
56 MsoVnfAdapterAsyncImpl instance = new MsoVnfAdapterAsyncImpl();
\r
57 MsoRequest msoRequest = new MsoRequest();
\r
58 msoRequest.setRequestId("12345");
\r
59 msoRequest.setServiceInstanceId("12345");
\r
61 Map<String, String> map = new HashMap<>();
\r
62 map.put("key1", "value1");
\r
64 instance.updateVnfA("mdt1", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "vSAMP12", "VFMOD",
\r
65 "volumeGroupHeatStackId|1", map, "messageId", msoRequest,
\r
66 "http://org.openecomp.mso/notify/adapterNotify/updateVnfNotificationRequest");
\r
67 } catch (Exception e) {
\r
73 public void queryVnfTest() {
\r
74 MsoVnfAdapterAsyncImpl instance = new MsoVnfAdapterAsyncImpl();
\r
75 MsoRequest msoRequest = new MsoRequest();
\r
76 msoRequest.setRequestId("12345");
\r
77 msoRequest.setServiceInstanceId("12345");
\r
79 instance.queryVnfA("mdt1", "88a6ca3ee0394ade9403f075db23167e", "vSAMP12", "messageId", msoRequest,
\r
80 "http://org.openecomp.mso/notify/adapterNotify/updateVnfNotificationRequest");
\r
81 } catch (Exception e) {
\r
87 public void deleteVnfTest() {
\r
88 MsoVnfAdapterAsyncImpl instance = new MsoVnfAdapterAsyncImpl();
\r
89 MsoRequest msoRequest = new MsoRequest();
\r
90 msoRequest.setRequestId("12345");
\r
91 msoRequest.setServiceInstanceId("12345");
\r
93 instance.deleteVnfA("mdt1", "88a6ca3ee0394ade9403f075db23167e", "vSAMP12", "messageId", msoRequest,
\r
94 "http://org.openecomp.mso/notify/adapterNotify/updateVnfNotificationRequest");
\r
95 } catch (Exception e) {
\r
101 public void rollbackVnfTest() {
\r
102 MsoVnfAdapterAsyncImpl instance = new MsoVnfAdapterAsyncImpl();
\r
103 VnfRollback vnfRollBack = new VnfRollback();
\r
104 vnfRollBack.setCloudSiteId("mdt1");
\r
105 vnfRollBack.setTenantId("88a6ca3ee0394ade9403f075db23167e");
\r
106 vnfRollBack.setVnfId("ff5256d1-5a33-55df-13ab-12abad84e7ff");
\r
108 instance.rollbackVnfA(vnfRollBack, "messageId",
\r
109 "http://org.openecomp.mso/notify/adapterNotify/updateVnfNotificationRequest");
\r
110 } catch (Exception e) {
\r