6e5f288829bdea58decfbc1c58495e06e0790c51
[vfc/nfvo/driver/vnfm/svnfm.git] /
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.rest;
18
19 import static org.junit.Assert.assertEquals;
20
21 import org.junit.Test;
22 import org.onap.vfc.nfvo.vnfm.svnfm.vnfmadapter.service.adapter.impl.AdapterResourceManager;
23 import org.onap.vfc.nfvo.vnfm.svnfm.vnfmadapter.service.rest.VnfAdapterResourceRoa;
24
25 import mockit.Mock;
26 import mockit.MockUp;
27 import net.sf.json.JSONObject;
28
29 /**
30  * <br>
31  * <p>
32  * </p>
33  * 
34  * @author
35  * @version NFVO 0.5 Jan 13, 2017
36  */
37 public class VnfAdapterResourceRoaTest {
38
39     @Test
40     public void testGetAllCloudInfo() {
41         new MockUp<AdapterResourceManager>() {
42
43             @Mock
44             public JSONObject getAllCloud(String url) {
45                 JSONObject resultObj = new JSONObject();
46                 resultObj.put("dn", "test");
47                 return resultObj;
48             }
49         };
50
51         VnfAdapterResourceRoa vnfAdapter = new VnfAdapterResourceRoa();
52         String result = vnfAdapter.getAllCloudInfo(null);
53         assertEquals("test", result);
54     }
55
56 }