diff options
author | sarada prasad sahoo <sarada.prasad.sahoo@huawei.com> | 2019-09-03 15:27:13 +0530 |
---|---|---|
committer | sarada prasad sahoo <sarada.prasad.sahoo@huawei.com> | 2019-09-04 18:53:13 +0530 |
commit | 073d731620daa5dd08e41fcabfe7f5a463485e22 (patch) | |
tree | 033b97906b8b3c4de69c5086c748f217b5a25064 /asdc-controller/src/test/java/org | |
parent | 687cdacb9fd74629e94ebc0914ba8c72bb5015a5 (diff) |
fix public NS distribution issue
Fix Multiple VFModule under single service distribution
Issue-ID: SO-2275
Change-Id: I7a4a7dbb68d23c0e44f9985b3fdc89816dbfd232
Signed-off-by: sarada prasad sahoo <sarada.prasad.sahoo@huawei.com>
Diffstat (limited to 'asdc-controller/src/test/java/org')
-rw-r--r-- | asdc-controller/src/test/java/org/onap/so/asdc/client/test/rest/ASDCRestInterfaceTest.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/client/test/rest/ASDCRestInterfaceTest.java b/asdc-controller/src/test/java/org/onap/so/asdc/client/test/rest/ASDCRestInterfaceTest.java index 2a4b3aa6fb..fc72f9bc6e 100644 --- a/asdc-controller/src/test/java/org/onap/so/asdc/client/test/rest/ASDCRestInterfaceTest.java +++ b/asdc-controller/src/test/java/org/onap/so/asdc/client/test/rest/ASDCRestInterfaceTest.java @@ -319,6 +319,30 @@ public class ASDCRestInterfaceTest extends BaseTest { assertEquals("CCVPNService", service.get().getModelName()); } + @Test + public void test_PublicNS_Distribution() throws Exception { + wireMockServer.stubFor(post(urlPathMatching("/aai/.*")) + .willReturn(aResponse().withStatus(200).withHeader("Content-Type", "application/json"))); + + wireMockServer.stubFor(post(urlPathMatching("/v1.0/activity-spec")) + .willReturn(aResponse().withHeader("Content-Type", "application/json") + .withStatus(org.springframework.http.HttpStatus.ACCEPTED.value()))); + + String resourceLocation = "src/test/resources/resource-examples/public-ns/"; + ObjectMapper mapper = new ObjectMapper(); + NotificationDataImpl request = mapper.readValue(new File(resourceLocation + "demo-public-ns-notification.json"), + NotificationDataImpl.class); + headers.add("resource-location", resourceLocation); + HttpEntity<NotificationDataImpl> entity = new HttpEntity<NotificationDataImpl>(request, headers); + ResponseEntity<String> response = restTemplate.exchange(createURLWithPort("test/treatNotification/v1"), + HttpMethod.POST, entity, String.class); + assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); + + Optional<Service> service = serviceRepo.findById("da28696e-d4c9-4df4-9f91-465c6c09a81e"); + assertTrue(service.isPresent()); + assertEquals("PublicNS", service.get().getModelName()); + } + protected String createURLWithPort(String uri) { return "http://localhost:" + port + uri; } |