summaryrefslogtreecommitdiffstats
path: root/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter
diff options
context:
space:
mode:
authorByung-Woo Jun <byung-woo.jun@est.tech>2020-01-09 15:42:32 +0000
committerGerrit Code Review <gerrit@onap.org>2020-01-09 15:42:32 +0000
commit9d77758d706d13c1c2ea46ada1837d757adbf9ba (patch)
tree8a42076c162bac36dbab3177d0f88134db768435 /adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter
parent3f7c17acb545c47b64f5c44f9baa048ed4a6982e (diff)
parent4def87fdf530f783323a5686db95d857dd6e8b4e (diff)
Merge "Fixed testOnGetPackageVnfd_UnauthorizedClient_Fail"
Diffstat (limited to 'adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter')
-rw-r--r--adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementControllerTest.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementControllerTest.java b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementControllerTest.java
index 6147748fa4..74ddebed74 100644
--- a/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementControllerTest.java
+++ b/adapters/mso-vnfm-adapter/mso-vnfm-etsi-adapter/src/test/java/org/onap/so/adapters/vnfmadapter/rest/Sol003PackageManagementControllerTest.java
@@ -516,14 +516,13 @@ public class Sol003PackageManagementControllerTest {
@Test
public void testOnGetPackageVnfd_UnauthorizedClient_Fail() {
- final String testURL =
- "http://localhost:" + port + PACKAGE_MANAGEMENT_BASE_URL + "/vnf_packages/" + VNF_PACKAGE_ID + "/vnfd";
- final HttpEntity<?> request = new HttpEntity<>(basicHttpHeadersProvider.getHttpHeaders());
- final ResponseEntity<ProblemDetails> responseEntity =
- restTemplate.exchange(testURL, HttpMethod.GET, request, ProblemDetails.class);
+ mockRestServer.expect(requestTo(MSB_BASE_URL + "/" + VNF_PACKAGE_ID + "/vnfd"))
+ .andExpect(method(HttpMethod.GET)).andRespond(withStatus(HttpStatus.UNAUTHORIZED));
+
+ final ResponseEntity<ProblemDetails> responseEntity = sendHttpRequest(VNF_PACKAGE_ID + "/vnfd");
assertTrue(responseEntity.getBody() instanceof ProblemDetails);
- assertEquals(HttpStatus.UNAUTHORIZED, responseEntity.getStatusCode());
+ assertEquals(HttpStatus.INTERNAL_SERVER_ERROR, responseEntity.getStatusCode());
}
@Test