diff options
author | Piotr Jaszczyk <piotr.jaszczyk@nokia.com> | 2019-03-22 10:42:42 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-03-22 10:42:42 +0000 |
commit | d4fc5abcb85f2caa2d5062a063ca2d5ea339e73f (patch) | |
tree | 7908fc6ba2f66906a0c158d5a6ff757db092009c /prh-commons/src/test/java/org | |
parent | 941db7477e728b28631c98b851bff936a5bcecd4 (diff) | |
parent | c85d30c68054fe76eb0ffc9e9264336a37476451 (diff) |
Merge "Remove IP requirement"
Diffstat (limited to 'prh-commons/src/test/java/org')
-rw-r--r-- | prh-commons/src/test/java/org/onap/dcaegen2/services/prh/model/AaiJsonBodyBuilderTest.java | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/prh-commons/src/test/java/org/onap/dcaegen2/services/prh/model/AaiJsonBodyBuilderTest.java b/prh-commons/src/test/java/org/onap/dcaegen2/services/prh/model/AaiJsonBodyBuilderTest.java index d1995f33..60ce520c 100644 --- a/prh-commons/src/test/java/org/onap/dcaegen2/services/prh/model/AaiJsonBodyBuilderTest.java +++ b/prh-commons/src/test/java/org/onap/dcaegen2/services/prh/model/AaiJsonBodyBuilderTest.java @@ -57,4 +57,58 @@ class AaiJsonBodyBuilderTest { assertEquals(expectedResult, new AaiJsonBodyBuilderImpl().createJsonBody(model)); } + + @Test + void createJsonBodyWithoutIPs_shouldReturnJsonInString() { + + ConsumerDmaapModel model = ImmutableConsumerDmaapModel.builder() + .correlationId("NOKnhfsadhff") + .serialNumber("1234") + .equipVendor("NOKIA") + .equipModel("3310") + .equipType("cell") + .nfRole("role") + .swVersion("1.2.3") + .build(); + + String expectedResult = "{" + + "\"correlationId\":\"NOKnhfsadhff\"," + + "\"serial-number\":\"1234\"," + + "\"equip-vendor\":\"NOKIA\"," + + "\"equip-model\":\"3310\"," + + "\"equip-type\":\"cell\"," + + "\"nf-role\":\"role\"," + + "\"sw-version\":\"1.2.3\"" + + "}"; + + assertEquals(expectedResult, new AaiJsonBodyBuilderImpl().createJsonBody(model)); + } + + @Test + void createJsonBodyWithEmptyIPs_shouldReturnJsonInString() { + + ConsumerDmaapModel model = ImmutableConsumerDmaapModel.builder() + .correlationId("NOKnhfsadhff") + .ipv4("") + .ipv6("") + .serialNumber("1234") + .equipVendor("NOKIA") + .equipModel("3310") + .equipType("cell") + .nfRole("role") + .swVersion("1.2.3") + .build(); + + String expectedResult = "{" + + "\"correlationId\":\"NOKnhfsadhff\"," + + "\"serial-number\":\"1234\"," + + "\"equip-vendor\":\"NOKIA\"," + + "\"equip-model\":\"3310\"," + + "\"equip-type\":\"cell\"," + + "\"nf-role\":\"role\"," + + "\"sw-version\":\"1.2.3\"" + + "}"; + + assertEquals(expectedResult, new AaiJsonBodyBuilderImpl().createJsonBody(model)); + } } |