X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=nokiav2%2Fdriver%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fvfc%2Fnfvo%2Fdriver%2Fvnfm%2Fsvnfm%2Fnokia%2Frestapi%2FTestConverterApi.java;fp=nokiav2%2Fdriver%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fvfc%2Fnfvo%2Fdriver%2Fvnfm%2Fsvnfm%2Fnokia%2Frestapi%2FTestConverterApi.java;h=48d2cab06ce0f2fb4a685a53b698c69b7d606b1f;hb=ce16741b481dbaae3a3447f84efb2b4ce5dffc82;hp=8a79a33a433782ea5ecc7e22c009c4ee64c0a4f2;hpb=b425177693b1fd0063a3bb499c7d6183da9434aa;p=vfc%2Fnfvo%2Fdriver%2Fvnfm%2Fsvnfm.git diff --git a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/TestConverterApi.java b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/TestConverterApi.java index 8a79a33a..48d2cab0 100644 --- a/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/TestConverterApi.java +++ b/nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/TestConverterApi.java @@ -73,6 +73,9 @@ public class TestConverterApi extends TestBase { Part part = Mockito.mock(Part.class); when(part.getInputStream()).thenReturn(new ByteArrayInputStream(TestUtil.loadFile("unittests/packageconverter/cbam.package.zip"))); when(httpRequest.getPart("fileToUpload")).thenReturn(part); + Part part2 = Mockito.mock(Part.class); + when(httpRequest.getPart("version")).thenReturn(part2); + when(part2.getInputStream()).thenReturn(new ByteArrayInputStream("V1".getBytes())); //when converterApi.convert(httpResponse, httpRequest); //verify @@ -117,6 +120,9 @@ public class TestConverterApi extends TestBase { public void testUnableToExtractPackageToBeConverted() throws Exception { IOException expectedException = new IOException(); when(httpRequest.getPart("fileToUpload")).thenThrow(expectedException); + Part part = Mockito.mock(Part.class); + when(httpRequest.getPart("version")).thenReturn(part); + when(part.getInputStream()).thenReturn(new ByteArrayInputStream("V1".getBytes())); try { converterApi.convert(httpResponse, httpRequest); fail(); @@ -135,6 +141,10 @@ public class TestConverterApi extends TestBase { Part part = Mockito.mock(Part.class); when(part.getInputStream()).thenReturn(new ByteArrayInputStream(TestUtil.loadFile("unittests/packageconverter/cbam.package.zip"))); when(httpRequest.getPart("fileToUpload")).thenReturn(part); + + Part part2 = Mockito.mock(Part.class); + when(httpRequest.getPart("version")).thenReturn(part2); + when(part2.getInputStream()).thenReturn(new ByteArrayInputStream("V1".getBytes())); try { converterApi.convert(httpResponse, httpRequest); fail();