diff options
author | 2017-10-07 11:56:25 +0800 | |
---|---|---|
committer | 2017-10-07 12:03:16 +0800 | |
commit | a84b3aeee6331420f3017ff65764823058aa8b95 (patch) | |
tree | 9aec20cbfcac828d077d0501705dc5a90e59dbad /nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test | |
parent | 6bde25ddca5ae6e8c479de6d55d29b083490ab4a (diff) |
Make code compliant with ONAP requirement
Change-Id: I60f1a13ac612b29df22d1cacd2d57ff314a745d6
Issue-ID: VFC-53
Signed-off-by: yufei_zhou <yufei.zhou@nokia-sbell.com>
Diffstat (limited to 'nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test')
3 files changed, 11 insertions, 7 deletions
diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/aai/impl/AaiMgmrInfImplTest.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/aai/impl/AaiMgmrInfImplTest.java index 23a4893f..ceeb6fba 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/aai/impl/AaiMgmrInfImplTest.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/aai/impl/AaiMgmrInfImplTest.java @@ -22,6 +22,7 @@ import java.io.IOException; import java.util.HashMap; import org.apache.http.client.ClientProtocolException; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.mockito.InjectMocks; @@ -52,7 +53,7 @@ public class AaiMgmrInfImplTest { String json = "{" + "\"vnfm-id\":\"vnfm-id_001\"," - + "\"esr-system-info-list\":[{\"ip\" : \"1.3.5.6\"}]" + + "\"esr-system-info-list\":[{\"ip-address\" : \"1.3.5.6\"}]" + "}" + ""; HttpResult httpResult = new HttpResult(); @@ -65,6 +66,6 @@ public class AaiMgmrInfImplTest { public void testQueryVnfPackage() throws ClientProtocolException, IOException { AaiVnfmInfo vnfmInfo = aaiMgmr.queryVnfm(vnfmId); -// Assert.assertEquals("1.3.5.6", vnfmInfo.getEsrSystemInfoList().get(0).getIp()); + Assert.assertEquals("1.3.5.6", vnfmInfo.getEsrSystemInfoList().get(0).getIp()); } } diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/VnfmDriverMgmrImplTest.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/VnfmDriverMgmrImplTest.java index aa24bf3c..b738fcc5 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/VnfmDriverMgmrImplTest.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/adaptor/VnfmDriverMgmrImplTest.java @@ -180,11 +180,10 @@ public class VnfmDriverMgmrImplTest { public void testQueryVnf() throws ClientProtocolException, IOException { CBAMQueryVnfResponse mockCbamResponse = new CBAMQueryVnfResponse(); mockCbamResponse.setId("executionId_001"); - + mockCbamResponse.setVnfdId(vnfInstanceId); when(cbamMgmr.queryVnf(Mockito.anyString())).thenReturn(mockCbamResponse); - ScaleVnfRequest request = new ScaleVnfRequest(); - request.setType(CommonEnum.ScaleType.SCALE_IN); QueryVnfResponse response = vnfmDriverMgmr.queryVnf(vnfmId, vnfInstanceId); + Assert.assertEquals(vnfInstanceId, response.getVnfdId()); } @Test @@ -201,8 +200,9 @@ public class VnfmDriverMgmrImplTest { cbamResponse.setGrantId("001002001"); when(cbamMgmr.queryOperExecution(Mockito.anyString())).thenReturn(cbamResponse); - ScaleVnfRequest request = new ScaleVnfRequest(); OperStatusVnfResponse response = vnfmDriverMgmr.getOperStatus(vnfmId, "1"); + + Assert.assertEquals("executionId_001", response.getJobId()); } } diff --git a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/catalog/impl/CatalogMgmrImplTest.java b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/catalog/impl/CatalogMgmrImplTest.java index a8ad4ae3..33ca1761 100644 --- a/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/catalog/impl/CatalogMgmrImplTest.java +++ b/nokia/vnfmdriver/vfcadaptorservice/vfcadaptor/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/catalog/impl/CatalogMgmrImplTest.java @@ -22,6 +22,7 @@ import java.io.IOException; import java.util.HashMap; import org.apache.http.client.ClientProtocolException; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.mockito.InjectMocks; @@ -61,10 +62,12 @@ public class CatalogMgmrImplTest { when(httpClientProcessor.process(Mockito.anyString(), Mockito.any(RequestMethod.class), Mockito.any(HashMap.class), Mockito.anyString())).thenReturn(httpResult); } + @Test public void testQueryVnfPackage() throws ClientProtocolException, IOException { - VnfPackageInfo response = catalogMgmr.queryVnfPackage(vnfPackageId); + VnfPackageInfo packageInfo = catalogMgmr.queryVnfPackage(vnfPackageId); + Assert.assertEquals("1.3.5.6", packageInfo.getDownloadUri()); } } |