2 * Copyright 2016-2017 ZTE Corporation.
\r
4 * Licensed under the Apache License, Version 2.0 (the "License");
\r
5 * you may not use this file except in compliance with the License.
\r
6 * You may obtain a copy of the License at
\r
8 * http://www.apache.org/licenses/LICENSE-2.0
\r
10 * Unless required by applicable law or agreed to in writing, software
\r
11 * distributed under the License is distributed on an "AS IS" BASIS,
\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 * See the License for the specific language governing permissions and
\r
14 * limitations under the License.
\r
16 package org.onap.aai.esr.externalservice.aai;
\r
18 import org.junit.Before;
\r
19 import org.junit.Test;
\r
20 import org.onap.aai.esr.common.MsbConfig;
\r
21 import org.onap.aai.esr.entity.aai.EsrEmsDetail;
\r
22 import org.onap.aai.esr.entity.aai.EsrThirdpartySdncDetail;
\r
23 import org.onap.aai.esr.entity.aai.EsrVnfmDetail;
\r
24 import org.onap.aai.esr.entity.aai.EsrNfvoDetail;
\r
25 import org.onap.aai.esr.exception.ExtsysException;
\r
27 public class ExternalSystemProxyTest {
\r
29 ExternalSystemProxy externalSystemProxy;
\r
32 public void init() {
\r
33 MsbConfig.setMsbServerAddr("http://msb-server");
\r
34 externalSystemProxy = new ExternalSystemProxy();
\r
37 @Test(expected = ExtsysException.class)
\r
38 public void testRegisterVnfm() throws ExtsysException {
\r
39 EsrVnfmDetail detail = new EsrVnfmDetail();
\r
40 externalSystemProxy.registerVnfm("vnfm-1", detail);
\r
43 @Test(expected = ExtsysException.class)
\r
44 public void testQueryVnfmDetail() throws ExtsysException {
\r
45 externalSystemProxy.queryVnfmDetail("vnfm-1");
\r
48 @Test(expected = ExtsysException.class)
\r
49 public void testQueryVnfmList() throws ExtsysException {
\r
50 externalSystemProxy.queryVnfmList();
\r
53 @Test(expected = ExtsysException.class)
\r
54 public void testDeleteVnfm() throws ExtsysException {
\r
55 externalSystemProxy.deleteVnfm("vnfm-1", "version-1");
\r
58 @Test(expected = ExtsysException.class)
\r
59 public void testRegisterNfvo() throws ExtsysException {
\r
60 EsrNfvoDetail detail = new EsrNfvoDetail();
\r
61 externalSystemProxy.registerNfvo("nfvo-1", detail);
\r
64 @Test(expected = ExtsysException.class)
\r
65 public void testQueryNfvoDetail() throws ExtsysException {
\r
66 externalSystemProxy.queryNfvoDetail("nfvo-1");
\r
69 @Test(expected = ExtsysException.class)
\r
70 public void testQueryNfvoList() throws ExtsysException {
\r
71 externalSystemProxy.queryNfvoList();
\r
74 @Test(expected = ExtsysException.class)
\r
75 public void testDeleteNfvo() throws ExtsysException {
\r
76 externalSystemProxy.deleteNfvo("nfvo-1", "version-1");
\r
82 @Test(expected = ExtsysException.class)
\r
83 public void testRegisterSdnc() throws ExtsysException {
\r
84 EsrThirdpartySdncDetail detail = new EsrThirdpartySdncDetail();
\r
85 externalSystemProxy.registerSdnc("sdnc-1", detail);
\r
88 @Test(expected = ExtsysException.class)
\r
89 public void testQueryThirdpartySdncDetail() throws ExtsysException {
\r
90 externalSystemProxy.queryThirdpartySdncDetail("sdnc-1");
\r
93 @Test(expected = ExtsysException.class)
\r
94 public void testQuerySdncList() throws ExtsysException {
\r
95 externalSystemProxy.querySdncList();
\r
98 @Test(expected = ExtsysException.class)
\r
99 public void testDeleteThirdpartySdnc() throws ExtsysException {
\r
100 externalSystemProxy.deleteThirdpartySdnc("sdnc-1", "version-1");
\r
103 @Test(expected = ExtsysException.class)
\r
104 public void testRegisterEms() throws ExtsysException {
\r
105 EsrEmsDetail detail = new EsrEmsDetail();
\r
106 externalSystemProxy.registerEms("ems-1", detail);
\r
109 @Test(expected = ExtsysException.class)
\r
110 public void testQueryEmsDetail() throws ExtsysException {
\r
111 externalSystemProxy.queryEmsDetail("ems-1");
\r
114 @Test(expected = ExtsysException.class)
\r
115 public void testQueryEmsList() throws ExtsysException {
\r
116 externalSystemProxy.queryEmsList();
\r
119 @Test(expected = ExtsysException.class)
\r
120 public void testDeleteEms() throws ExtsysException {
\r
121 externalSystemProxy.deleteEms("ems-1", "version-1");
\r