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.exception.ExtsysException;
\r
26 public class ExternalSystemProxyTest {
\r
28 ExternalSystemProxy externalSystemProxy;
\r
31 public void init() {
\r
32 MsbConfig.setMsbServerAddr("http://msb-server");
\r
33 externalSystemProxy = new ExternalSystemProxy();
\r
36 @Test(expected = ExtsysException.class)
\r
37 public void testRegisterVnfm() throws ExtsysException{
\r
38 EsrVnfmDetail detail = new EsrVnfmDetail();
\r
39 ExternalSystemProxy.registerVnfm("vnfm-1", detail);
\r
42 @Test(expected = ExtsysException.class)
\r
43 public void testQueryVnfmDetail() throws ExtsysException{
\r
44 ExternalSystemProxy.queryVnfmDetail("vnfm-1");
\r
47 @Test(expected = ExtsysException.class)
\r
48 public void testQueryVnfmList() throws ExtsysException{
\r
49 ExternalSystemProxy.queryVnfmList();
\r
52 @Test(expected = ExtsysException.class)
\r
53 public void testDeleteVnfm() throws ExtsysException{
\r
54 ExternalSystemProxy.deleteVnfm("vnfm-1", "version-1");
\r
57 @Test(expected = ExtsysException.class)
\r
58 public void testRegisterSdnc() throws ExtsysException{
\r
59 EsrThirdpartySdncDetail detail = new EsrThirdpartySdncDetail();
\r
60 ExternalSystemProxy.registerSdnc("sdnc-1", detail);
\r
63 @Test(expected = ExtsysException.class)
\r
64 public void testQueryThirdpartySdncDetail() throws ExtsysException{
\r
65 ExternalSystemProxy.queryThirdpartySdncDetail("sdnc-1");
\r
68 @Test(expected = ExtsysException.class)
\r
69 public void testQuerySdncList() throws ExtsysException{
\r
70 ExternalSystemProxy.querySdncList();
\r
73 @Test(expected = ExtsysException.class)
\r
74 public void testDeleteThirdpartySdnc() throws ExtsysException{
\r
75 ExternalSystemProxy.deleteThirdpartySdnc("sdnc-1", "version-1");
\r
78 @Test(expected = ExtsysException.class)
\r
79 public void testRegisterEms() throws ExtsysException{
\r
80 EsrEmsDetail detail = new EsrEmsDetail();
\r
81 ExternalSystemProxy.registerEms("ems-1",detail);
\r
84 @Test(expected = ExtsysException.class)
\r
85 public void testQueryEmsDetail() throws ExtsysException{
\r
86 ExternalSystemProxy.queryEmsDetail("ems-1");
\r
89 @Test(expected = ExtsysException.class)
\r
90 public void testQueryEmsList() throws ExtsysException{
\r
91 ExternalSystemProxy.queryEmsList();
\r
94 @Test(expected = ExtsysException.class)
\r
95 public void testDeleteEms() throws ExtsysException{
\r
96 ExternalSystemProxy.deleteEms("ems-1", "version-1");
\r