summaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actor.vfc
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2023-01-31 10:41:01 +0000
committerliamfallon <liam.fallon@est.tech>2023-01-31 12:12:05 +0000
commite3938e43b8a1f02f74368ecb75c38530285feac0 (patch)
tree02a042ca672a935fce40fe81120bfffd13cec10f /models-interactions/model-actors/actor.vfc
parent8cf623781404f98aeacfc44e1bc8a7f1bf8446ad (diff)
Upgrade and clean up dependencies
- Upgrade Hibernate - Upgrade Mockito - Upgrade Mockserver - Remove Powermock (no longer supported) and replace with spring-test ReflectionTestUtils - Upgrade Spring Framework - Add spring-security to allow authentication on unit tests using MockMVC Minor clean-up - Replace deprecated authorization configuraiton on spring boot applications with SecurityFilterChain bean - Change @LocalPort include on tests to use test include rather than runtime include - Remove unused imports - Remove unused constants and variables - Add deprecation annotations where required Issue-ID: POLICY-4482 Change-Id: Ie8d6ee1e8bcdad282bcef3cad409c5c109e907f1 Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'models-interactions/model-actors/actor.vfc')
-rw-r--r--models-interactions/model-actors/actor.vfc/pom.xml8
-rw-r--r--models-interactions/model-actors/actor.vfc/src/test/java/org/onap/policy/controlloop/actor/vfc/BasicVfcOperation.java15
-rw-r--r--models-interactions/model-actors/actor.vfc/src/test/java/org/onap/policy/controlloop/actor/vfc/RestartTest.java4
-rw-r--r--models-interactions/model-actors/actor.vfc/src/test/java/org/onap/policy/controlloop/actor/vfc/VfcOperationTest.java4
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;