diff options
Diffstat (limited to 'prh-app-server/src/test')
-rw-r--r-- | prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/BbsActionsTaskTest.java | 8 | ||||
-rw-r--r-- | prh-app-server/src/test/resources/BbsActionsTaskTestFiles/logicalLinkBodyWithSpace.json | 1 |
2 files changed, 6 insertions, 3 deletions
diff --git a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/BbsActionsTaskTest.java b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/BbsActionsTaskTest.java index bc754bf8..f060ac7b 100644 --- a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/BbsActionsTaskTest.java +++ b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/BbsActionsTaskTest.java @@ -66,6 +66,7 @@ class BbsActionsTaskTest { private static final String PNF_WITH_LINK_JSON = "BbsActionsTaskTestFiles/pnfWithLogicalLink.json"; private static final String LOGICAL_LINK_JSON = "BbsActionsTaskTestFiles/oldLogicalLink.json"; private static final String LOGICAL_LINK_BODY = "BbsActionsTaskTestFiles/logicalLinkBody.json"; + private static final String LOGICAL_LINK_BODY_WITH_SPACE = "BbsActionsTaskTestFiles/logicalLinkBodyWithSpace.json"; private CbsConfiguration cbsConfiguration = mock(CbsConfiguration.class); @@ -111,7 +112,8 @@ class BbsActionsTaskTest { given(cbsConfiguration.getAaiClientConfiguration()).willReturn(aaiClientConfiguration); JsonObject additionalFields = new JsonObject(); - String linkName = "some-link"; + String linkName = "some link"; + String encodedLinkName = "some%20link"; additionalFields.addProperty(ATTACHMENT_POINT, linkName); ConsumerDmaapModel consumerDmaapModel = buildConsumerDmaapModel(additionalFields); @@ -136,9 +138,9 @@ class BbsActionsTaskTest { assertEquals(AAI_URL + PNF_URL + "/Nokia123", pnfGet.url()); assertEquals(GET, pnfGet.method()); - assertEquals(AAI_URL + LOGICAL_LINK_URL + "/" + linkName, linkPut.url()); + assertEquals(AAI_URL + LOGICAL_LINK_URL + "/" + encodedLinkName, linkPut.url()); assertEquals(PUT, linkPut.method()); - assertEquals(getBodyJson(LOGICAL_LINK_BODY), extractBodyFromRequest(linkPut)); + assertEquals(getBodyJson(LOGICAL_LINK_BODY_WITH_SPACE), extractBodyFromRequest(linkPut)); } @Test diff --git a/prh-app-server/src/test/resources/BbsActionsTaskTestFiles/logicalLinkBodyWithSpace.json b/prh-app-server/src/test/resources/BbsActionsTaskTestFiles/logicalLinkBodyWithSpace.json new file mode 100644 index 00000000..9cdd7010 --- /dev/null +++ b/prh-app-server/src/test/resources/BbsActionsTaskTestFiles/logicalLinkBodyWithSpace.json @@ -0,0 +1 @@ +{"link-name":"some link","link-type":"attachment-point","relationship-list":{"relationship":[{"related-link":"/network/pnfs/pnf/Nokia123","relationship-data":[]}]}}
\ No newline at end of file |