4fdd7057afa6f99e388daad0b4eb956e7ce6be26
[vfc/nfvo/driver/vnfm/svnfm.git] / huawei / vnfmadapter / VnfmadapterService / service / src / test / java / org / onap / vfc / nfvo / vnfm / svnfm / vnfmadapter / service / process / RegisterMgrTest.java
1 /*
2  * Copyright 2017 Huawei Technologies Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package org.onap.vfc.nfvo.vnfm.svnfm.vnfmadapter.service.process;
18
19 import org.junit.Test;
20 import org.onap.vfc.nfvo.vnfm.svnfm.vnfmadapter.common.servicetoken.VnfmRestfulUtil;
21 import org.onap.vfc.nfvo.vnfm.svnfm.vnfmadapter.service.process.RegisterMgr;
22 import org.onap.vfc.nfvo.vnfm.svnfm.vnfmadapter.common.restclient.RestfulResponse;
23
24 import mockit.Mock;
25 import mockit.MockUp;
26
27 /**
28  * <br>
29  * <p>
30  * </p>
31  * 
32  * @author
33  * @version VFC 1.0 Jan 13, 2017
34  */
35 public class RegisterMgrTest {
36
37     @Test
38     public void testRegister() {
39         new MockUp<VnfmRestfulUtil>() {
40
41             @Mock
42             public RestfulResponse getRemoteResponse(String url, String methodType, String params) {
43                 RestfulResponse rsp = new RestfulResponse();
44                 rsp.setStatus(200);
45                 return rsp;
46             }
47         };
48         RegisterMgr register = new RegisterMgr();
49         register.register();
50     }
51
52     @Test
53     public void testUnRegister() {
54         new MockUp<VnfmRestfulUtil>() {
55
56             @Mock
57             public RestfulResponse getRemoteResponse(String url, String methodType, String params) {
58                 RestfulResponse rsp = new RestfulResponse();
59                 rsp.setStatus(200);
60                 return rsp;
61             }
62         };
63         RegisterMgr register = new RegisterMgr();
64         register.unRegister();
65     }
66
67 }