From b77b1160c9391f7b0cf1a16ce7e203a45203fb6a Mon Sep 17 00:00:00 2001 From: FrancescoFioraEst Date: Thu, 2 Feb 2023 10:20:43 +0000 Subject: Fix issue in StartAndStop Activator Test Issue-ID: POLICY-4547 Change-Id: I2b9320c79b9a9ab6df587065b7a0638ff06d16be Signed-off-by: FrancescoFioraEst --- .../config/messaging/MessageDispatcherActivatorTest.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'runtime-acm') diff --git a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/config/messaging/MessageDispatcherActivatorTest.java b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/config/messaging/MessageDispatcherActivatorTest.java index 7d49bc2f6..f45517f7c 100644 --- a/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/config/messaging/MessageDispatcherActivatorTest.java +++ b/runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/config/messaging/MessageDispatcherActivatorTest.java @@ -27,15 +27,12 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyList; import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.spy; 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.Disabled; import org.junit.jupiter.api.Test; -import org.onap.policy.clamp.acm.runtime.main.parameters.AcRuntimeParameterGroup; import org.onap.policy.clamp.acm.runtime.supervision.comm.ParticipantStatusListener; import org.onap.policy.clamp.acm.runtime.util.CommonTestData; import org.onap.policy.clamp.models.acm.messages.dmaap.participant.ParticipantStatus; @@ -54,20 +51,19 @@ class MessageDispatcherActivatorTest { private static final String TOPIC_FIRST = "TOPIC1"; private static final String TOPIC_SECOND = "TOPIC2"; - @Disabled @Test void testStartAndStop() throws Exception { - AcRuntimeParameterGroup parameterGroup = CommonTestData.geParameterGroup("dbtest"); + var parameterGroup = CommonTestData.geParameterGroup("dbtest"); - var publisherFirst = spy(mock(Publisher.class)); - var publisherSecond = spy(mock(Publisher.class)); + var publisherFirst = mock(Publisher.class); + var publisherSecond = mock(Publisher.class); var publishers = List.of(publisherFirst, publisherSecond); - var listenerFirst = spy(mock(ParticipantStatusListener.class)); + var listenerFirst = mock(ParticipantStatusListener.class); when(listenerFirst.getType()).thenReturn(TOPIC_FIRST); when(listenerFirst.getScoListener()).thenReturn(listenerFirst); - var listenerSecond = spy(mock(ParticipantStatusListener.class)); + var listenerSecond = mock(ParticipantStatusListener.class); when(listenerSecond.getType()).thenReturn(TOPIC_SECOND); when(listenerSecond.getScoListener()).thenReturn(listenerSecond); @@ -85,7 +81,7 @@ class MessageDispatcherActivatorTest { verify(publisherFirst, times(1)).active(anyList()); verify(publisherSecond, times(1)).active(anyList()); - StandardCoderObject sco = CODER.decode("{messageType:" + TOPIC_FIRST + "}", StandardCoderObject.class); + var sco = CODER.decode("{messageType:" + TOPIC_FIRST + "}", StandardCoderObject.class); activator.getMsgDispatcher().onTopicEvent(null, "msg", sco); verify(listenerFirst, times(1)).onTopicEvent(any(), any(), any()); -- cgit 1.2.3-korg