diff options
author | FrancescoFioraEst <francesco.fiora@est.tech> | 2021-08-18 15:25:59 +0100 |
---|---|---|
committer | FrancescoFioraEst <francesco.fiora@est.tech> | 2021-08-26 13:44:57 +0100 |
commit | 6d02de6b9ea3f4e6fc588813fd2177c732a2af92 (patch) | |
tree | 71d74f431b35e950767be889a2b6d7ed1de7af45 /participant/participant-impl/participant-impl-policy | |
parent | 281a36c50d68f29e0e47dfec10ee8be38f5e5761 (diff) |
Fix issue in event handling in participants
Fix issue in event handling in participants
and refactor Participant Publisher and Listener
Issue-ID: POLICY-3544
Change-Id: Ic92ffa79d303adfb1c3319fbfefb1faef911a9d4
Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'participant/participant-impl/participant-impl-policy')
-rw-r--r-- | participant/participant-impl/participant-impl-policy/src/test/java/org/onap/policy/clamp/controlloop/participant/policy/endtoend/ParticipantMessagesTest.java | 14 |
1 files changed, 8 insertions, 6 deletions
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 699df25e8..8187378ae 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 @@ -85,7 +85,8 @@ class ParticipantMessagesTest { synchronized (lockit) { ParticipantMessagePublisher participantMessagePublisher = - new ParticipantMessagePublisher(Collections.singletonList(Mockito.mock(TopicSink.class))); + new ParticipantMessagePublisher(); + participantMessagePublisher.active(Collections.singletonList(Mockito.mock(TopicSink.class))); participantMessagePublisher.sendParticipantRegister(participantRegisterMsg); } } @@ -113,7 +114,8 @@ class ParticipantMessagesTest { synchronized (lockit) { ParticipantMessagePublisher participantMessagePublisher = - new ParticipantMessagePublisher(Collections.singletonList(Mockito.mock(TopicSink.class))); + new ParticipantMessagePublisher(); + participantMessagePublisher.active(Collections.singletonList(Mockito.mock(TopicSink.class))); participantMessagePublisher.sendParticipantDeregister(participantDeregisterMsg); } } @@ -153,8 +155,8 @@ class ParticipantMessagesTest { participantUpdateAckMsg.setResult(true); synchronized (lockit) { - ParticipantMessagePublisher participantMessagePublisher = - new ParticipantMessagePublisher(Collections.singletonList(Mockito.mock(TopicSink.class))); + ParticipantMessagePublisher participantMessagePublisher = new ParticipantMessagePublisher(); + participantMessagePublisher.active(Collections.singletonList(Mockito.mock(TopicSink.class))); participantMessagePublisher.sendParticipantUpdateAck(participantUpdateAckMsg); } } @@ -163,8 +165,8 @@ class ParticipantMessagesTest { void testParticipantStatusHeartbeat() throws Exception { final ParticipantStatus heartbeat = participantHandler.makeHeartbeat(true); synchronized (lockit) { - ParticipantMessagePublisher publisher = - new ParticipantMessagePublisher(Collections.singletonList(Mockito.mock(TopicSink.class))); + ParticipantMessagePublisher publisher = new ParticipantMessagePublisher(); + publisher.active(Collections.singletonList(Mockito.mock(TopicSink.class))); assertThatCode(() -> publisher.sendHeartbeat(heartbeat)).doesNotThrowAnyException(); } } |