summaryrefslogtreecommitdiffstats
path: root/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vnf-repository-rest-services/src/test/java/org/openecomp/sdcrests/vsp/rest/services/VnfPackageRepositoryImplTest.java
diff options
context:
space:
mode:
authorvempo <vitaliy.emporopulo@amdocs.com>2018-08-05 18:06:55 +0300
committerAvi Gaffa <avi.gaffa@amdocs.com>2018-08-06 10:26:55 +0000
commitaa8057fa429db6852a86ad217a641bb2bf12123c (patch)
tree8beaab8678f4a20cbfc91bad025ae39f07de62c8 /openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vnf-repository-rest-services/src/test/java/org/openecomp/sdcrests/vsp/rest/services/VnfPackageRepositoryImplTest.java
parent04ff1b844c58f9f53558ff70594bf52ef6fba6ae (diff)
Resolved slf4j binding conflict in tests
Removed an slf4j binding, moved dependencies up to the dependencyManagement of root POM, improved logging. Change-Id: I21eb5160adac7d520363a524e679962be4754d11 Issue-ID: SDC-1278 Signed-off-by: vempo <vitaliy.emporopulo@amdocs.com>
Diffstat (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vnf-repository-rest-services/src/test/java/org/openecomp/sdcrests/vsp/rest/services/VnfPackageRepositoryImplTest.java')
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vnf-repository-rest-services/src/test/java/org/openecomp/sdcrests/vsp/rest/services/VnfPackageRepositoryImplTest.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vnf-repository-rest-services/src/test/java/org/openecomp/sdcrests/vsp/rest/services/VnfPackageRepositoryImplTest.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vnf-repository-rest-services/src/test/java/org/openecomp/sdcrests/vsp/rest/services/VnfPackageRepositoryImplTest.java
index b0f53bac34..0f790036da 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vnf-repository-rest-services/src/test/java/org/openecomp/sdcrests/vsp/rest/services/VnfPackageRepositoryImplTest.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vnf-repository-rest-services/src/test/java/org/openecomp/sdcrests/vsp/rest/services/VnfPackageRepositoryImplTest.java
@@ -53,6 +53,7 @@ public class VnfPackageRepositoryImplTest {
@ClassRule
public static final WireMockRule wireMockRule = new WireMockRule(wireMockConfig().dynamicPort());
+
private static final String VSP = "anyVsp";
private static final String VERSION = "anyVersion";
private static final String USER = "anyUser";
@@ -88,7 +89,7 @@ public class VnfPackageRepositoryImplTest {
@Test
public void listVnfsReturnsInternalServerErrorWhenRemoteClientError() {
- stubFor(get(GET_PATH).willReturn(aResponse().withStatus(403)));
+ stubFor(get(GET_PATH).willReturn(aResponse().withStatus(403).withBody("Forbidden")));
VnfPackageRepositoryImpl repository = new VnfPackageRepositoryImpl(config);
Response response = repository.getVnfPackages(VSP, VERSION, USER);
assertEquals(500, response.getStatus());
@@ -97,7 +98,7 @@ public class VnfPackageRepositoryImplTest {
@Test
public void listVnfsReturnsInternalServerErrorWhenRemoteReturnsNotOk() {
- stubFor(get(GET_PATH).willReturn(aResponse().withStatus(204)));
+ stubFor(get(GET_PATH).willReturn(aResponse().withStatus(201).withBody("Created")));
VnfPackageRepositoryImpl repository = new VnfPackageRepositoryImpl(config);
Response response = repository.getVnfPackages(VSP, VERSION, USER);
assertEquals(500, response.getStatus());
@@ -117,7 +118,7 @@ public class VnfPackageRepositoryImplTest {
@Test
public void downloadVnfsReturnsInternalServerErrorWhenRemoteClientError() {
- stubFor(get(DOWNLOAD_PATH).willReturn(aResponse().withStatus(403)));
+ stubFor(get(DOWNLOAD_PATH).willReturn(aResponse().withStatus(403).withBody("{\"error\": \"Permissions\"}")));
VnfPackageRepositoryImpl repository = new VnfPackageRepositoryImpl(config);
Response response = repository.downloadVnfPackage(VSP, VERSION, CSAR, USER);
assertEquals(500, response.getStatus());
@@ -126,7 +127,7 @@ public class VnfPackageRepositoryImplTest {
@Test
public void downloadVnfsReturnsInternalServerErrorWhenRemoteReturnsNotOk() {
- stubFor(get(DOWNLOAD_PATH).willReturn(aResponse().withStatus(204)));
+ stubFor(get(DOWNLOAD_PATH).willReturn(aResponse().withStatus(201).withBody(new byte[0])));
VnfPackageRepositoryImpl repository = new VnfPackageRepositoryImpl(config);
Response response = repository.downloadVnfPackage(VSP, VERSION, CSAR, USER);
assertEquals(500, response.getStatus());