X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=main%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpap%2Fmain%2Fcomm%2FCommonRequestBase.java;h=2a4cdc4c25062feb9edd8ec7c5f422a2c941c175;hb=ce1e7de6148c00b00a2a48b0c2504fc8918db9dc;hp=4086b6a1bc5402676fe57892bb98270c0ab8ed74;hpb=6aa64b948942b402b496b84b89186bcd276ce04c;p=policy%2Fpap.git diff --git a/main/src/test/java/org/onap/policy/pap/main/comm/CommonRequestBase.java b/main/src/test/java/org/onap/policy/pap/main/comm/CommonRequestBase.java index 4086b6a1..2a4cdc4c 100644 --- a/main/src/test/java/org/onap/policy/pap/main/comm/CommonRequestBase.java +++ b/main/src/test/java/org/onap/policy/pap/main/comm/CommonRequestBase.java @@ -3,7 +3,7 @@ * ONAP PAP * ================================================================================ * Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2021 Nordix Foundation. + * Modifications Copyright (C) 2021-2022 Nordix Foundation. * Modifications Copyright (C) 2022 Bell Canada. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -36,7 +36,6 @@ import java.util.function.Consumer; import org.junit.Before; import org.junit.BeforeClass; import org.mockito.ArgumentCaptor; -import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure; import org.onap.policy.common.endpoints.listeners.RequestIdDispatcher; @@ -77,6 +76,7 @@ public class CommonRequestBase { protected static final PdpState MY_STATE = PdpState.SAFE; protected static final PdpState DIFF_STATE = PdpState.TERMINATED; protected static final int RETRIES = 1; + protected static final String PDP_PAP_TOPIC = "POLICY-PDP-PAP"; protected Publisher publisher; protected PolicyNotifier notifier; @@ -112,12 +112,9 @@ public class CommonRequestBase { listener = mock(RequestListener.class); PdpParameters pdpParams = mock(PdpParameters.class); - doAnswer(new Answer() { - @Override - public Object answer(InvocationOnMock invocation) throws Throwable { - queue.add(invocation.getArgument(0, QueueToken.class)); - return null; - } + doAnswer((Answer) invocation -> { + queue.add(invocation.getArgument(0, QueueToken.class)); + return null; }).when(publisher).enqueue(any()); when(timers.register(any(), any())).thenReturn(timer); @@ -151,7 +148,7 @@ public class CommonRequestBase { verify(dispatcher).register(any(), processResp.capture()); - processResp.getValue().onTopicEvent(CommInfrastructure.NOOP, PapConstants.TOPIC_POLICY_PDP_PAP, response); + processResp.getValue().onTopicEvent(CommInfrastructure.NOOP, PDP_PAP_TOPIC, response); } /**