From 6d02de6b9ea3f4e6fc588813fd2177c732a2af92 Mon Sep 17 00:00:00 2001 From: FrancescoFioraEst Date: Wed, 18 Aug 2021 15:25:59 +0100 Subject: 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 --- .../runtime/config/messaging/MessageDispatcherActivatorTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'runtime-controlloop/src/test') diff --git a/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/config/messaging/MessageDispatcherActivatorTest.java b/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/config/messaging/MessageDispatcherActivatorTest.java index 461c8b558..936bb1444 100644 --- a/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/config/messaging/MessageDispatcherActivatorTest.java +++ b/runtime-controlloop/src/test/java/org/onap/policy/clamp/controlloop/runtime/config/messaging/MessageDispatcherActivatorTest.java @@ -31,6 +31,7 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; +import java.util.List; import org.junit.jupiter.api.Test; import org.onap.policy.clamp.controlloop.runtime.main.parameters.ClRuntimeParameterGroup; import org.onap.policy.clamp.controlloop.runtime.supervision.comm.ParticipantStatusListener; @@ -56,7 +57,7 @@ class MessageDispatcherActivatorTest { var publisherFirst = spy(mock(Publisher.class)); var publisherSecond = spy(mock(Publisher.class)); - var publishers = new Publisher[] {publisherFirst, publisherSecond}; + var publishers = List.of(publisherFirst, publisherSecond); var listenerFirst = spy(mock(ParticipantStatusListener.class)); when(listenerFirst.getType()).thenReturn(TOPIC_FIRST); @@ -66,7 +67,7 @@ class MessageDispatcherActivatorTest { when(listenerSecond.getType()).thenReturn(TOPIC_SECOND); when(listenerSecond.getScoListener()).thenReturn(listenerSecond); - var listeners = new Listener[] {listenerFirst, listenerSecond}; + List listeners = List.of(listenerFirst, listenerSecond); try (var activator = new MessageDispatcherActivator(parameterGroup, publishers, listeners)) { -- cgit 1.2.3-korg