diff options
author | Yan Yang <yangyanyj@chinamobile.com> | 2018-05-31 00:55:37 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-05-31 00:55:37 +0000 |
commit | 3ec51cb825272e0ef32c0e7cb197bfc7f1519b97 (patch) | |
tree | bb7f52cd3b241328eae331790849b0bd024f1b22 /nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/TestConverterApi.java | |
parent | 1e6859ddd141a5cbc6d8b9fcd5c190e75c92d7f3 (diff) | |
parent | ce16741b481dbaae3a3447f84efb2b4ce5dffc82 (diff) |
Merge "Fix template generator for R2"
Diffstat (limited to 'nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/TestConverterApi.java')
-rw-r--r-- | nokiav2/driver/src/test/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/restapi/TestConverterApi.java | 10 |
1 files changed, 10 insertions, 0 deletions
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(); |