Add Nfvo external system backend changes in ESR
[aai/esr-server.git] / esr-mgr / src / test / java / org / onap / aai / esr / externalservice / aai / ExternalSystemProxyTest.java
1 /**\r
2  * Copyright 2016-2017 ZTE Corporation.\r
3  *\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
7  *\r
8  *     http://www.apache.org/licenses/LICENSE-2.0\r
9  *\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
15  */\r
16 package org.onap.aai.esr.externalservice.aai;\r
17 \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
26 \r
27 public class ExternalSystemProxyTest {\r
28 \r
29     ExternalSystemProxy externalSystemProxy;\r
30 \r
31     @Before\r
32     public void init() {\r
33         MsbConfig.setMsbServerAddr("http://msb-server");\r
34         externalSystemProxy = new ExternalSystemProxy();\r
35     }\r
36 \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
41     }\r
42 \r
43     @Test(expected = ExtsysException.class)\r
44     public void testQueryVnfmDetail() throws ExtsysException {\r
45         externalSystemProxy.queryVnfmDetail("vnfm-1");\r
46     }\r
47 \r
48     @Test(expected = ExtsysException.class)\r
49     public void testQueryVnfmList() throws ExtsysException {\r
50         externalSystemProxy.queryVnfmList();\r
51     }\r
52 \r
53     @Test(expected = ExtsysException.class)\r
54     public void testDeleteVnfm() throws ExtsysException {\r
55         externalSystemProxy.deleteVnfm("vnfm-1", "version-1");\r
56     }\r
57 \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
62     }\r
63 \r
64     @Test(expected = ExtsysException.class)\r
65     public void testQueryNfvoDetail() throws ExtsysException {\r
66         externalSystemProxy.queryNfvoDetail("nfvo-1");\r
67     }\r
68 \r
69     @Test(expected = ExtsysException.class)\r
70     public void testQueryNfvoList() throws ExtsysException {\r
71         externalSystemProxy.queryNfvoList();\r
72     }\r
73 \r
74     @Test(expected = ExtsysException.class)\r
75     public void testDeleteNfvo() throws ExtsysException {\r
76         externalSystemProxy.deleteNfvo("nfvo-1", "version-1");\r
77     }\r
78 \r
79 \r
80 \r
81 \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
86     }\r
87 \r
88     @Test(expected = ExtsysException.class)\r
89     public void testQueryThirdpartySdncDetail() throws ExtsysException {\r
90         externalSystemProxy.queryThirdpartySdncDetail("sdnc-1");\r
91     }\r
92 \r
93     @Test(expected = ExtsysException.class)\r
94     public void testQuerySdncList() throws ExtsysException {\r
95         externalSystemProxy.querySdncList();\r
96     }\r
97 \r
98     @Test(expected = ExtsysException.class)\r
99     public void testDeleteThirdpartySdnc() throws ExtsysException {\r
100         externalSystemProxy.deleteThirdpartySdnc("sdnc-1", "version-1");\r
101     }\r
102 \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
107     }\r
108 \r
109     @Test(expected = ExtsysException.class)\r
110     public void testQueryEmsDetail() throws ExtsysException {\r
111         externalSystemProxy.queryEmsDetail("ems-1");\r
112     }\r
113 \r
114     @Test(expected = ExtsysException.class)\r
115     public void testQueryEmsList() throws ExtsysException {\r
116         externalSystemProxy.queryEmsList();\r
117     }\r
118 \r
119     @Test(expected = ExtsysException.class)\r
120     public void testDeleteEms() throws ExtsysException {\r
121         externalSystemProxy.deleteEms("ems-1", "version-1");\r
122     }\r
123 }\r