09e6318436c6a278ce0e37ada2691b022927a580
[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.exception.ExtsysException;\r
25 \r
26 public class ExternalSystemProxyTest {\r
27 \r
28     ExternalSystemProxy externalSystemProxy;\r
29 \r
30     @Before\r
31     public void init() {\r
32         MsbConfig.setMsbServerAddr("http://msb-server");\r
33         externalSystemProxy = new ExternalSystemProxy();\r
34     }\r
35 \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
40     }\r
41 \r
42     @Test(expected = ExtsysException.class)\r
43     public void testQueryVnfmDetail() throws ExtsysException {\r
44         ExternalSystemProxy.queryVnfmDetail("vnfm-1");\r
45     }\r
46 \r
47     @Test(expected = ExtsysException.class)\r
48     public void testQueryVnfmList() throws ExtsysException {\r
49         ExternalSystemProxy.queryVnfmList();\r
50     }\r
51 \r
52     @Test(expected = ExtsysException.class)\r
53     public void testDeleteVnfm() throws ExtsysException {\r
54         ExternalSystemProxy.deleteVnfm("vnfm-1", "version-1");\r
55     }\r
56 \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
61     }\r
62 \r
63     @Test(expected = ExtsysException.class)\r
64     public void testQueryThirdpartySdncDetail() throws ExtsysException {\r
65         ExternalSystemProxy.queryThirdpartySdncDetail("sdnc-1");\r
66     }\r
67 \r
68     @Test(expected = ExtsysException.class)\r
69     public void testQuerySdncList() throws ExtsysException {\r
70         ExternalSystemProxy.querySdncList();\r
71     }\r
72 \r
73     @Test(expected = ExtsysException.class)\r
74     public void testDeleteThirdpartySdnc() throws ExtsysException {\r
75         ExternalSystemProxy.deleteThirdpartySdnc("sdnc-1", "version-1");\r
76     }\r
77 \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
82     }\r
83 \r
84     @Test(expected = ExtsysException.class)\r
85     public void testQueryEmsDetail() throws ExtsysException {\r
86         ExternalSystemProxy.queryEmsDetail("ems-1");\r
87     }\r
88 \r
89     @Test(expected = ExtsysException.class)\r
90     public void testQueryEmsList() throws ExtsysException {\r
91         ExternalSystemProxy.queryEmsList();\r
92     }\r
93 \r
94     @Test(expected = ExtsysException.class)\r
95     public void testDeleteEms() throws ExtsysException {\r
96         ExternalSystemProxy.deleteEms("ems-1", "version-1");\r
97     }\r
98 }\r