X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=models-interactions%2Fmodel-actors%2Factor.aai%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fpolicy%2Fcontrolloop%2Factor%2Faai%2FAaiCustomQueryOperationTest.java;fp=models-interactions%2Fmodel-actors%2Factor.aai%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fpolicy%2Fcontrolloop%2Factor%2Faai%2FAaiCustomQueryOperationTest.java;h=dd6d0ec18f32ca2f9422735a5b82c443d3c6fd38;hb=e3938e43b8a1f02f74368ecb75c38530285feac0;hp=3cec9b602b64479ee5052250f0116bf0c60cdb70;hpb=8cf623781404f98aeacfc44e1bc8a7f1bf8446ad;p=policy%2Fmodels.git diff --git a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperationTest.java b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperationTest.java index 3cec9b602..dd6d0ec18 100644 --- a/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperationTest.java +++ b/models-interactions/model-actors/actor.aai/src/test/java/org/onap/policy/controlloop/actor/aai/AaiCustomQueryOperationTest.java @@ -3,6 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,6 +27,7 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.lenient; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -41,6 +43,8 @@ import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.junit.MockitoJUnitRunner; import org.onap.policy.aai.AaiConstants; import org.onap.policy.aai.AaiCqResponse; import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance; @@ -51,6 +55,7 @@ import org.onap.policy.controlloop.actorserviceprovider.OperationResult; import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpConfig; import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpParams; +@RunWith(MockitoJUnitRunner.class) public class AaiCustomQueryOperationTest extends BasicAaiOperation { private static final StandardCoder coder = new StandardCoder(); @@ -124,7 +129,7 @@ public class AaiCustomQueryOperationTest extends BasicAaiOperation { public void testStartOperationAsync_testMakeRequest() throws Exception { // need two responses when(rawResponse.readEntity(String.class)).thenReturn(makeTenantReply()).thenReturn(makeCqReply()); - when(webAsync.get(any(InvocationCallback.class))).thenAnswer(provideResponse(rawResponse)); + lenient().when(webAsync.get(any(InvocationCallback.class))).thenAnswer(provideResponse(rawResponse)); when(webAsync.put(any(), any(InvocationCallback.class))).thenAnswer(provideResponse(rawResponse, 1)); CompletableFuture future2 = oper.start();