diff options
author | sarada prasad sahoo <sarada.prasad.sahoo@huawei.com> | 2019-10-07 12:34:49 +0530 |
---|---|---|
committer | sarada prasad sahoo <sarada.prasad.sahoo@huawei.com> | 2019-10-07 12:34:49 +0530 |
commit | 6392515d91c00df8cb925ec9e99273a2f9e4744f (patch) | |
tree | 7877fd63f456ddfc7e23d64a89138c0d3d02f64e /asdc-controller/src/test/java | |
parent | 6f8ed4f558226640d00b2069ae3e8d254364f80a (diff) |
SO Distribution Error on Allotted Resource
SO Distribution Error on Allotted Resource - duplicate primary
Issue-ID: SO-2351
Signed-off-by: sarada prasad sahoo <sarada.prasad.sahoo@huawei.com>
Change-Id: Iae7bda27ac4975b5ede657ac485472bbc6e88c56
Diffstat (limited to 'asdc-controller/src/test/java')
-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 7171fff812..9294677b95 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 @@ -366,6 +366,30 @@ public class ASDCRestInterfaceTest extends BaseTest { assertEquals("PublicNS", service.get().getModelName()); } + @Test + public void test_Vcperescust_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/vcpe-rescust/"; + ObjectMapper mapper = new ObjectMapper(); + NotificationDataImpl request = mapper.readValue( + new File(resourceLocation + "demo-vcpe-rescust-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("d3aac917-543d-4421-b6d7-ba2b65884eb7"); + assertTrue(service.isPresent()); + assertEquals("vCPEResCust 2019-10-01 _2364", service.get().getModelName()); + } + protected String createURLWithPort(String uri) { return "http://localhost:" + port + uri; } |