summaryrefslogtreecommitdiffstats
path: root/participant/participant-impl/participant-impl-policy
diff options
context:
space:
mode:
Diffstat (limited to 'participant/participant-impl/participant-impl-policy')
-rw-r--r--participant/participant-impl/participant-impl-policy/src/main/resources/config/application.yaml2
-rw-r--r--participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/controlloop/participant/policy/endtoend/ParticipantMessagesTest.java18
-rw-r--r--participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/controlloop/participant/policy/main/parameters/CommonTestData.java2
3 files changed, 20 insertions, 2 deletions
diff --git a/participant/participant-impl/participant-impl-policy/src/main/resources/config/application.yaml b/participant/participant-impl/participant-impl-policy/src/main/resources/config/application.yaml
index d4c7d7561..ef158ce97 100644
--- a/participant/participant-impl/participant-impl-policy/src/main/resources/config/application.yaml
+++ b/participant/participant-impl/participant-impl-policy/src/main/resources/config/application.yaml
@@ -9,7 +9,7 @@ participant:
https: true
allowSelfSignedCerts: true
intermediaryParameters:
- reportingTimeInterval: 120000
+ reportingTimeIntervalMs: 120000
description: Participant Description
participantId:
name: org.onap.PM_Policy
diff --git a/participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/controlloop/participant/policy/endtoend/ParticipantMessagesTest.java b/participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/controlloop/participant/policy/endtoend/ParticipantMessagesTest.java
index 4b4558b89..093ac190c 100644
--- a/participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/controlloop/participant/policy/endtoend/ParticipantMessagesTest.java
+++ b/participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/controlloop/participant/policy/endtoend/ParticipantMessagesTest.java
@@ -20,6 +20,8 @@
package org.onap.policy.clamp.controlloop.participant.policy.endtoend;
+import static org.assertj.core.api.Assertions.assertThatCode;
+
import java.time.Instant;
import java.util.Collections;
import java.util.UUID;
@@ -30,6 +32,8 @@ import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.Parti
import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantDeregisterAck;
import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantRegister;
import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantRegisterAck;
+import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantResponseDetails;
+import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantStatus;
import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantUpdate;
import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.ParticipantUpdateAck;
import org.onap.policy.clamp.controlloop.participant.intermediary.comm.ParticipantDeregisterAckListener;
@@ -139,6 +143,20 @@ class ParticipantMessagesTest {
}
}
+ @Test
+ void testParticipantStatusHeartbeat() throws Exception {
+ final ParticipantStatus heartbeat = new ParticipantStatus();
+ heartbeat.setMessage("ParticipantStatus message");
+ heartbeat.setResponse(new ParticipantResponseDetails());
+ heartbeat.setParticipantId(getParticipantId());
+ synchronized (lockit) {
+ ParticipantMessagePublisher publisher =
+ new ParticipantMessagePublisher(Collections.singletonList(Mockito.mock(TopicSink.class)));
+ assertThatCode(() -> publisher.sendHeartbeat(heartbeat)).doesNotThrowAnyException();
+ }
+ }
+
+
private ToscaConceptIdentifier getParticipantId() {
return new ToscaConceptIdentifier("org.onap.PM_Policy", "1.0.0");
}
diff --git a/participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/controlloop/participant/policy/main/parameters/CommonTestData.java b/participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/controlloop/participant/policy/main/parameters/CommonTestData.java
index 38861472c..a34c9cda5 100644
--- a/participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/controlloop/participant/policy/main/parameters/CommonTestData.java
+++ b/participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/controlloop/participant/policy/main/parameters/CommonTestData.java
@@ -99,7 +99,7 @@ public class CommonTestData {
final Map<String, Object> map = new TreeMap<>();
if (!isEmpty) {
map.put("name", "Participant parameters");
- map.put("reportingTimeInterval", TIME_INTERVAL);
+ map.put("reportingTimeIntervalMs", TIME_INTERVAL);
map.put("description", DESCRIPTION);
map.put("participantId", getParticipantId());
map.put("participantType", getParticipantId());