diff options
author | pwielebs <piotr.wielebski@nokia.com> | 2018-08-30 12:02:31 +0200 |
---|---|---|
committer | pwielebs <piotr.wielebski@nokia.com> | 2018-08-30 12:02:31 +0200 |
commit | ed4d45332691282e7e0dc4bb413d20f46e1a0a66 (patch) | |
tree | 5bb2c06ef453ae8868cbd0f1b04ce9375c165459 /prh-commons/src | |
parent | 4fbb9e8ad097c9ec3c3434ba257e887fb3a64699 (diff) |
Introduction of a new parameter "sourceName"
- used instead of pnf-name (correlationId)
Change-Id: Iabcbfacbc029bd6d229080c2064a291e17c7f4f8
Issue-ID: DCAEGEN2-744
Signed-off-by: pwielebs <piotr.wielebski@nokia.com>
Diffstat (limited to 'prh-commons/src')
5 files changed, 11 insertions, 11 deletions
diff --git a/prh-commons/src/main/java/org/onap/dcaegen2/services/prh/model/CommonFunctions.java b/prh-commons/src/main/java/org/onap/dcaegen2/services/prh/model/CommonFunctions.java index 66a0a998..145d9176 100644 --- a/prh-commons/src/main/java/org/onap/dcaegen2/services/prh/model/CommonFunctions.java +++ b/prh-commons/src/main/java/org/onap/dcaegen2/services/prh/model/CommonFunctions.java @@ -40,6 +40,6 @@ public class CommonFunctions { GsonBuilder gsonBuilder = new GsonBuilder(); ServiceLoader.load(TypeAdapterFactory.class).forEach(gsonBuilder::registerTypeAdapterFactory); return gsonBuilder.create().toJson(ImmutableConsumerDmaapModel.builder().ipv4(consumerDmaapModel.getIpv4()) - .ipv6(consumerDmaapModel.getIpv6()).pnfName(consumerDmaapModel.getPnfName()).build()); + .ipv6(consumerDmaapModel.getIpv6()).sourceName(consumerDmaapModel.getSourceName()).build()); } } diff --git a/prh-commons/src/main/java/org/onap/dcaegen2/services/prh/model/ConsumerDmaapModel.java b/prh-commons/src/main/java/org/onap/dcaegen2/services/prh/model/ConsumerDmaapModel.java index 4c99ba3a..f34256c5 100644 --- a/prh-commons/src/main/java/org/onap/dcaegen2/services/prh/model/ConsumerDmaapModel.java +++ b/prh-commons/src/main/java/org/onap/dcaegen2/services/prh/model/ConsumerDmaapModel.java @@ -32,8 +32,8 @@ import org.immutables.value.Value; @Gson.TypeAdapters(fieldNamingStrategy = true) public interface ConsumerDmaapModel { - @SerializedName(value = "pnf-name", alternate = "pnf-name") - String getPnfName(); + @SerializedName(value = "sourceName", alternate = "sourceName") + String getSourceName(); @SerializedName(value = "ipaddress-v4-oam", alternate = "ipaddress-v4-oam") String getIpv4(); diff --git a/prh-commons/src/main/java/org/onap/dcaegen2/services/prh/model/ConsumerDmaapModelForUnitTest.java b/prh-commons/src/main/java/org/onap/dcaegen2/services/prh/model/ConsumerDmaapModelForUnitTest.java index 569a7a7c..339ddb6d 100644 --- a/prh-commons/src/main/java/org/onap/dcaegen2/services/prh/model/ConsumerDmaapModelForUnitTest.java +++ b/prh-commons/src/main/java/org/onap/dcaegen2/services/prh/model/ConsumerDmaapModelForUnitTest.java @@ -22,7 +22,7 @@ package org.onap.dcaegen2.services.prh.model; public class ConsumerDmaapModelForUnitTest implements ConsumerDmaapModel { - private final String pnfName; + private final String sourceName; private final String ipv4; private final String ipv6; @@ -30,14 +30,14 @@ public class ConsumerDmaapModelForUnitTest implements ConsumerDmaapModel { * Class for testing serialization of ConsumerDmaapModel. */ public ConsumerDmaapModelForUnitTest() { - this.pnfName = "NOKnhfsadhff"; + this.sourceName = "NOKnhfsadhff"; this.ipv4 = "256.22.33.155"; this.ipv6 = "2001:0db8:85a3:0000:0000:8a2e:0370:7334"; } - public String getPnfName() { - return pnfName; + public String getSourceName() { + return sourceName; } public String getIpv4() { diff --git a/prh-commons/src/test/java/org/onap/dcaegen2/services/prh/model/CommonFunctionsTest.java b/prh-commons/src/test/java/org/onap/dcaegen2/services/prh/model/CommonFunctionsTest.java index d4c947fd..470704a2 100644 --- a/prh-commons/src/test/java/org/onap/dcaegen2/services/prh/model/CommonFunctionsTest.java +++ b/prh-commons/src/test/java/org/onap/dcaegen2/services/prh/model/CommonFunctionsTest.java @@ -47,7 +47,7 @@ class CommonFunctionsTest { @Test void createJsonBody_shouldReturnJsonInString() { - String expectedResult = "{\"pnf-name\":\"NOKnhfsadhff\",\"ipaddress-v4-oam\":\"256.22.33.155\"" + String expectedResult = "{\"sourceName\":\"NOKnhfsadhff\",\"ipaddress-v4-oam\":\"256.22.33.155\"" + ",\"ipaddress-v6-oam\":\"2001:0db8:85a3:0000:0000:8a2e:0370:7334\"}"; assertEquals(expectedResult, CommonFunctions.createJsonBody(model)); } diff --git a/prh-commons/src/test/java/org/onap/dcaegen2/services/prh/model/ConsumerDmaapModelTest.java b/prh-commons/src/test/java/org/onap/dcaegen2/services/prh/model/ConsumerDmaapModelTest.java index 6b2f9abc..ed8d5293 100644 --- a/prh-commons/src/test/java/org/onap/dcaegen2/services/prh/model/ConsumerDmaapModelTest.java +++ b/prh-commons/src/test/java/org/onap/dcaegen2/services/prh/model/ConsumerDmaapModelTest.java @@ -30,18 +30,18 @@ class ConsumerDmaapModelTest { // When // Given - String pnfName = "NOKnhfsadhff"; + String sourceName = "NOKnhfsadhff"; String ipv4 = "11.22.33.155"; String ipv6 = "2001:0db8:85a3:0000:0000:8a2e:0370:7334"; ConsumerDmaapModel consumerDmaapModel = ImmutableConsumerDmaapModel.builder() - .pnfName(pnfName) + .sourceName(sourceName) .ipv4(ipv4) .ipv6(ipv6) .build(); // Then Assertions.assertNotNull(consumerDmaapModel); - Assertions.assertEquals(pnfName, consumerDmaapModel.getPnfName()); + Assertions.assertEquals(sourceName, consumerDmaapModel.getSourceName()); Assertions.assertEquals(ipv4, consumerDmaapModel.getIpv4()); Assertions.assertEquals(ipv6, consumerDmaapModel.getIpv6()); } |