diff options
Diffstat (limited to 'models-interactions/model-actors/actor.vfc')
4 files changed, 20 insertions, 11 deletions
diff --git a/models-interactions/model-actors/actor.vfc/pom.xml b/models-interactions/model-actors/actor.vfc/pom.xml index 4a25d4df0..347e59f2a 100644 --- a/models-interactions/model-actors/actor.vfc/pom.xml +++ b/models-interactions/model-actors/actor.vfc/pom.xml @@ -2,7 +2,7 @@ <!-- ============LICENSE_START======================================================= Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. - Modifications Copyright (C) 2019 Nordix Foundation. + Modifications Copyright (C) 2019,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. @@ -91,9 +91,9 @@ <scope>test</scope> </dependency> <dependency> - <groupId>org.powermock</groupId> - <artifactId>powermock-api-mockito2</artifactId> - <scope>test</scope> + <groupId>org.mockito</groupId> + <artifactId>mockito-core</artifactId> + <scope>compile</scope> </dependency> <dependency> <groupId>org.assertj</groupId> diff --git a/models-interactions/model-actors/actor.vfc/src/test/java/org/onap/policy/controlloop/actor/vfc/BasicVfcOperation.java b/models-interactions/model-actors/actor.vfc/src/test/java/org/onap/policy/controlloop/actor/vfc/BasicVfcOperation.java index 9014e3332..d83fd8ba8 100644 --- a/models-interactions/model-actors/actor.vfc/src/test/java/org/onap/policy/controlloop/actor/vfc/BasicVfcOperation.java +++ b/models-interactions/model-actors/actor.vfc/src/test/java/org/onap/policy/controlloop/actor/vfc/BasicVfcOperation.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. @@ -20,7 +21,7 @@ package org.onap.policy.controlloop.actor.vfc; -import static org.mockito.Mockito.when; +import static org.mockito.Mockito.lenient; import org.mockito.Mock; import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams; @@ -84,8 +85,8 @@ public abstract class BasicVfcOperation extends BasicHttpOperation { // PLD - when(rawResponse.getStatus()).thenReturn(200); - when(rawResponse.readEntity(String.class)).thenReturn(coder.encode(response)); + lenient().when(rawResponse.getStatus()).thenReturn(200); + lenient().when(rawResponse.readEntity(String.class)).thenReturn(coder.encode(response)); initConfig(); } @@ -93,10 +94,10 @@ public abstract class BasicVfcOperation extends BasicHttpOperation { @Override protected void initConfig() { super.initConfig(); - when(config.getClient()).thenReturn(client); - when(config.getMaxPolls()).thenReturn(MAX_POLLS); - when(config.getPollPath()).thenReturn(POLL_PATH); - when(config.getPollWaitSec()).thenReturn(POLL_WAIT_SEC); + lenient().when(config.getClient()).thenReturn(client); + lenient().when(config.getMaxPolls()).thenReturn(MAX_POLLS); + lenient().when(config.getPollPath()).thenReturn(POLL_PATH); + lenient().when(config.getPollWaitSec()).thenReturn(POLL_WAIT_SEC); } } diff --git a/models-interactions/model-actors/actor.vfc/src/test/java/org/onap/policy/controlloop/actor/vfc/RestartTest.java b/models-interactions/model-actors/actor.vfc/src/test/java/org/onap/policy/controlloop/actor/vfc/RestartTest.java index 75ed8b29b..ca7cefd93 100644 --- a/models-interactions/model-actors/actor.vfc/src/test/java/org/onap/policy/controlloop/actor/vfc/RestartTest.java +++ b/models-interactions/model-actors/actor.vfc/src/test/java/org/onap/policy/controlloop/actor/vfc/RestartTest.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. @@ -32,6 +33,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.common.endpoints.http.client.HttpClientFactoryInstance; import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome; import org.onap.policy.controlloop.actorserviceprovider.OperationProperties; @@ -41,6 +44,7 @@ import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpPollingPa import org.onap.policy.vfc.VfcRequest; import org.onap.policy.vfc.VfcResponse; +@RunWith(MockitoJUnitRunner.class) public class RestartTest extends BasicVfcOperation { private static final String TEST_SERVICE_INSTANCE_ID = "test-service-instance-id"; private static final String TEST_VSERVER_ID = "test-vserver-id"; diff --git a/models-interactions/model-actors/actor.vfc/src/test/java/org/onap/policy/controlloop/actor/vfc/VfcOperationTest.java b/models-interactions/model-actors/actor.vfc/src/test/java/org/onap/policy/controlloop/actor/vfc/VfcOperationTest.java index 4f20c12d4..aee9b323e 100644 --- a/models-interactions/model-actors/actor.vfc/src/test/java/org/onap/policy/controlloop/actor/vfc/VfcOperationTest.java +++ b/models-interactions/model-actors/actor.vfc/src/test/java/org/onap/policy/controlloop/actor/vfc/VfcOperationTest.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. @@ -28,10 +29,13 @@ import static org.junit.Assert.assertTrue; import org.junit.Before; import org.junit.Test; +import org.junit.runner.RunWith; import org.mockito.Mockito; +import org.mockito.junit.MockitoJUnitRunner; import org.onap.policy.vfc.VfcResponse; import org.onap.policy.vfc.VfcResponseDescriptor; +@RunWith(MockitoJUnitRunner.class) public class VfcOperationTest extends BasicVfcOperation { private VfcOperation oper; |