Send ParticipantStatusReq message using sync topic 20/138320/1
authorFrancescoFioraEst <francesco.fiora@est.tech>
Tue, 25 Jun 2024 12:39:45 +0000 (13:39 +0100)
committerFrancesco Fiora <francesco.fiora@est.tech>
Tue, 25 Jun 2024 15:32:32 +0000 (15:32 +0000)
Send ParticipantStatusReq message to all replicas using sync topic.

Issue-ID: POLICY-5061
Change-Id: I8a104df38a48efef8a8b4eb61f9a944f7434d0a3
Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
participant/participant-intermediary/src/main/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantStatusReqListener.java
participant/participant-intermediary/src/test/java/org/onap/policy/clamp/acm/participant/intermediary/comm/ParticipantCommTest.java
runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/comm/ParticipantStatusReqPublisher.java

index cfc5c6f..eaf89ec 100644 (file)
@@ -24,6 +24,7 @@ import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.mockito.Mockito.mock;
 
 import java.util.Collections;
@@ -52,12 +53,14 @@ class ParticipantCommTest {
         var participantRegisterAckListener = new ParticipantRegisterAckListener(participantHandler);
         participantRegisterAckListener.onTopicEvent(null, null, null, new ParticipantRegisterAck());
         assertEquals(ParticipantMessageType.PARTICIPANT_REGISTER_ACK.name(), participantRegisterAckListener.getType());
+        assertFalse(participantRegisterAckListener.isDefaultTopic());
         assertEquals(participantRegisterAckListener, participantRegisterAckListener.getScoListener());
 
         var participantStatusReqListener = new ParticipantStatusReqListener(participantHandler);
         participantStatusReqListener.onTopicEvent(null, null, null, new ParticipantStatusReq());
         assertEquals(ParticipantMessageType.PARTICIPANT_STATUS_REQ.name(), participantStatusReqListener.getType());
         assertEquals(participantStatusReqListener, participantStatusReqListener.getScoListener());
+        assertFalse(participantStatusReqListener.isDefaultTopic());
 
         var participantDeregisterAckListener = new ParticipantDeregisterAckListener(participantHandler);
         assertEquals(ParticipantMessageType.PARTICIPANT_DEREGISTER_ACK.name(),
@@ -65,6 +68,7 @@ class ParticipantCommTest {
 
         var participantPrimeListener = new ParticipantPrimeListener(participantHandler);
         assertEquals(ParticipantMessageType.PARTICIPANT_PRIME.name(), participantPrimeListener.getType());
+        assertTrue(participantPrimeListener.isDefaultTopic());
 
         var acPropertyUpdateListener = new AcPropertyUpdateListener(participantHandler);
         assertEquals(ParticipantMessageType.PROPERTIES_UPDATE.name(), acPropertyUpdateListener.getType());
@@ -80,6 +84,7 @@ class ParticipantCommTest {
         var participantSyncListener = new ParticipantSyncListener(participantHandler);
         assertEquals(ParticipantMessageType.PARTICIPANT_SYNC_MSG.name(),
                 participantSyncListener.getType());
+        assertFalse(participantSyncListener.isDefaultTopic());
 
         var acMigrationListener = new AutomationCompositionMigrationListener(participantHandler);
         assertEquals(ParticipantMessageType.AUTOMATION_COMPOSITION_MIGRATION.name(), acMigrationListener.getType());
index 2eb434b..1f6b7c8 100644 (file)
@@ -47,4 +47,9 @@ public class ParticipantStatusReqPublisher extends AbstractParticipantPublisher<
         LOGGER.debug("Participant StatusReq sent {}", message);
         super.send(message);
     }
+
+    @Override
+    public boolean isDefaultTopic() {
+        return false;
+    }
 }