* 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");
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;
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<PdpMessage> publisher;
protected PolicyNotifier notifier;
listener = mock(RequestListener.class);
PdpParameters pdpParams = mock(PdpParameters.class);
- doAnswer(new Answer<Object>() {
- @Override
- public Object answer(InvocationOnMock invocation) throws Throwable {
- queue.add(invocation.getArgument(0, QueueToken.class));
- return null;
- }
+ doAnswer((Answer<Object>) invocation -> {
+ queue.add(invocation.getArgument(0, QueueToken.class));
+ return null;
}).when(publisher).enqueue(any());
when(timers.register(any(), any())).thenReturn(timer);
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);
}
/**