summaryrefslogtreecommitdiffstats
path: root/controlloop/common/feature-controlloop-management/src/test
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2023-01-31 10:44:54 +0000
committerliamfallon <liam.fallon@est.tech>2023-01-31 12:56:17 +0000
commit0d52472a24ba317d6c96fcd215c7f2a2b6bd43f8 (patch)
treea4a5f06ba1ab41033f7cca9cc160333d87f20247 /controlloop/common/feature-controlloop-management/src/test
parent6895f4d2004cf3ccb94d9d7bbb0928db50dae39a (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: I8f3eeba7bd476c2b8e74a6a6a9d1f53b4c5304c3 Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'controlloop/common/feature-controlloop-management/src/test')
-rw-r--r--controlloop/common/feature-controlloop-management/src/test/java/org/onap/policy/drools/apps/controlloop/feature/management/ControlLoopManagementFeatureTest.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/controlloop/common/feature-controlloop-management/src/test/java/org/onap/policy/drools/apps/controlloop/feature/management/ControlLoopManagementFeatureTest.java b/controlloop/common/feature-controlloop-management/src/test/java/org/onap/policy/drools/apps/controlloop/feature/management/ControlLoopManagementFeatureTest.java
index e5034017f..2a9abafb8 100644
--- a/controlloop/common/feature-controlloop-management/src/test/java/org/onap/policy/drools/apps/controlloop/feature/management/ControlLoopManagementFeatureTest.java
+++ b/controlloop/common/feature-controlloop-management/src/test/java/org/onap/policy/drools/apps/controlloop/feature/management/ControlLoopManagementFeatureTest.java
@@ -3,6 +3,7 @@
* ONAP
* ================================================================================
* Copyright (C) 2018-2019 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.
@@ -21,7 +22,7 @@
package org.onap.policy.drools.apps.controlloop.feature.management;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -33,7 +34,7 @@ import org.junit.Test;
import org.onap.policy.drools.apps.controlloop.feature.management.ControlLoopManagementFeature.Factory;
import org.onap.policy.drools.controller.DroolsController;
import org.onap.policy.drools.system.PolicyController;
-import org.powermock.reflect.Whitebox;
+import org.springframework.test.util.ReflectionTestUtils;
/**
* Control Loop Management Feature Test.
@@ -47,12 +48,12 @@ public class ControlLoopManagementFeatureTest {
@BeforeClass
public static void setUpBeforeClass() {
- saveFactory = Whitebox.getInternalState(ControlLoopManagementFeature.class, FACTORY_FIELD);
+ saveFactory = (Factory) ReflectionTestUtils.getField(ControlLoopManagementFeature.class, FACTORY_FIELD);
}
@After
public void tearDown() {
- Whitebox.setInternalState(ControlLoopManagementFeature.class, FACTORY_FIELD, saveFactory);
+ ReflectionTestUtils.setField(ControlLoopManagementFeature.class, FACTORY_FIELD, saveFactory);
}
/**
@@ -74,7 +75,7 @@ public class ControlLoopManagementFeatureTest {
@Test
public void testControlLoops_InvalidArgs() {
Factory factory = mock(Factory.class);
- Whitebox.setInternalState(ControlLoopManagementFeature.class, FACTORY_FIELD, factory);
+ ReflectionTestUtils.setField(ControlLoopManagementFeature.class, FACTORY_FIELD, factory);
// returns null controller
when(factory.getController(any())).thenReturn(null);