summaryrefslogtreecommitdiffstats
path: root/prh-app-server
diff options
context:
space:
mode:
Diffstat (limited to 'prh-app-server')
-rw-r--r--prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/service/DmaapConsumerJsonParser.java5
-rw-r--r--prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/service/DmaapConsumerJsonParserTest.java6
-rw-r--r--prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AaiProducerTaskImplTest.java2
-rw-r--r--prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/DmaapConsumerTaskImplTest.java2
-rw-r--r--prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/DmaapPublisherTaskImplTest.java2
5 files changed, 9 insertions, 8 deletions
diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/service/DmaapConsumerJsonParser.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/service/DmaapConsumerJsonParser.java
index 4e34f6e6..1d121b38 100644
--- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/service/DmaapConsumerJsonParser.java
+++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/service/DmaapConsumerJsonParser.java
@@ -43,6 +43,7 @@ public class DmaapConsumerJsonParser {
private static final String OAM_IPV_4_ADDRESS = "oamV4IpAddress";
private static final String OAM_IPV_6_ADDRESS = "oamV6IpAddress";
private static final String SOURCE_NAME = "sourceName";
+ private static final String CORRELATION_ID = "correlationId";
/**
* Extract info from string and create @see {@link org.onap.dcaegen2.services.prh.model.ConsumerDmaapModel}.
@@ -99,7 +100,7 @@ public class DmaapConsumerJsonParser {
? Mono.error(new DmaapNotFoundException("Incorrect json, consumerDmaapModel can not be created: "
+ printMessage(pnfSourceName, pnfOamIpv4Address, pnfOamIpv6Address))) :
Mono.just(ImmutableConsumerDmaapModel.builder()
- .sourceName(pnfSourceName)
+ .correlationId(pnfSourceName)
.ipv4(pnfOamIpv4Address)
.ipv6(pnfOamIpv6Address).build());
}
@@ -118,7 +119,7 @@ public class DmaapConsumerJsonParser {
private String printMessage(String sourceName, String oamIpv4Address, String oamIpv6Address) {
return String.format("%n{"
- + "\"" + SOURCE_NAME + "\": \"%s\","
+ + "\"" + CORRELATION_ID + "\": \"%s\","
+ "\"" + OAM_IPV_4_ADDRESS + "\": \"%s\","
+ "\"" + OAM_IPV_6_ADDRESS + "\": \"%s\""
+ "%n}", sourceName, oamIpv4Address, oamIpv6Address);
diff --git a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/service/DmaapConsumerJsonParserTest.java b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/service/DmaapConsumerJsonParserTest.java
index 2cbb6800..225d46ee 100644
--- a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/service/DmaapConsumerJsonParserTest.java
+++ b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/service/DmaapConsumerJsonParserTest.java
@@ -76,7 +76,7 @@ class DmaapConsumerJsonParserTest {
ConsumerDmaapModel expectedObject = ImmutableConsumerDmaapModel.builder().ipv4("10.16.123.234")
.ipv6("0:0:0:0:0:FFFF:0A10:7BEA")
- .sourceName("NOKQTFCOC540002E").build();
+ .correlationId("NOKQTFCOC540002E").build();
//when
DmaapConsumerJsonParser dmaapConsumerJsonParser = spy(new DmaapConsumerJsonParser());
JsonElement jsonElement = new JsonParser().parse(parsed);
@@ -133,7 +133,7 @@ class DmaapConsumerJsonParserTest {
//then
ConsumerDmaapModel expectedObject = ImmutableConsumerDmaapModel.builder().ipv4("")
.ipv6("0:0:0:0:0:FFFF:0A10:7BEA")
- .sourceName("NOKQTFCOC540002E").build();
+ .correlationId("NOKQTFCOC540002E").build();
Assertions.assertNotNull(consumerDmaapModel);
Assertions.assertEquals(expectedObject, consumerDmaapModel);
}
@@ -172,7 +172,7 @@ class DmaapConsumerJsonParserTest {
+ "}}}";
ConsumerDmaapModel expectedObject = ImmutableConsumerDmaapModel.builder().ipv4("10.16.123.234").ipv6("")
- .sourceName("NOKQTFCOC540002E").build();
+ .correlationId("NOKQTFCOC540002E").build();
//when
DmaapConsumerJsonParser dmaapConsumerJsonParser = spy(new DmaapConsumerJsonParser());
JsonElement jsonElement = new JsonParser().parse(parsed);
diff --git a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AaiProducerTaskImplTest.java b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AaiProducerTaskImplTest.java
index f5cc6b24..6a9326e1 100644
--- a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AaiProducerTaskImplTest.java
+++ b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AaiProducerTaskImplTest.java
@@ -81,7 +81,7 @@ class AaiProducerTaskImplTest {
.build();
consumerDmaapModel = ImmutableConsumerDmaapModel.builder().ipv4("10.16.123.234")
.ipv6("0:0:0:0:0:FFFF:0A10:7BEA")
- .sourceName("NOKQTFCOC540002E").build();
+ .correlationId("NOKQTFCOC540002E").build();
appConfig = mock(AppConfig.class);
}
diff --git a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/DmaapConsumerTaskImplTest.java b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/DmaapConsumerTaskImplTest.java
index 6bcd9b2c..c128fb95 100644
--- a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/DmaapConsumerTaskImplTest.java
+++ b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/DmaapConsumerTaskImplTest.java
@@ -67,7 +67,7 @@ class DmaapConsumerTaskImplTest {
consumerDmaapModel = ImmutableConsumerDmaapModel.builder().ipv4("10.16.123.234")
.ipv6("0:0:0:0:0:FFFF:0A10:7BEA")
- .sourceName("NOKQTFCOC540002E").build();
+ .correlationId("NOKQTFCOC540002E").build();
appConfig = mock(AppConfig.class);
message = "[{\"event\": {"
diff --git a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/DmaapPublisherTaskImplTest.java b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/DmaapPublisherTaskImplTest.java
index c410fc35..fad7a067 100644
--- a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/DmaapPublisherTaskImplTest.java
+++ b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/DmaapPublisherTaskImplTest.java
@@ -65,7 +65,7 @@ class DmaapPublisherTaskImplTest {
.dmaapTopicName("unauthenticated.SEC_OTHER_OUTPUT").build();
consumerDmaapModel = ImmutableConsumerDmaapModel.builder().ipv4("10.16.123.234")
.ipv6("0:0:0:0:0:FFFF:0A10:7BEA")
- .sourceName("NOKQTFCOC540002E").build();
+ .correlationId("NOKQTFCOC540002E").build();
appConfig = mock(AppConfig.class);
}