summaryrefslogtreecommitdiffstats
path: root/integrity-monitor
diff options
context:
space:
mode:
Diffstat (limited to 'integrity-monitor')
-rw-r--r--integrity-monitor/pom.xml10
-rw-r--r--integrity-monitor/src/test/java/org/onap/policy/common/im/AllSeemsWellTest.java5
-rw-r--r--integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTest.java5
-rw-r--r--integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTestBase.java7
4 files changed, 18 insertions, 9 deletions
diff --git a/integrity-monitor/pom.xml b/integrity-monitor/pom.xml
index 8050b426..72762ef5 100644
--- a/integrity-monitor/pom.xml
+++ b/integrity-monitor/pom.xml
@@ -3,6 +3,7 @@
ONAP Policy Engine - Common Modules
================================================================================
Copyright (C) 2017-2021 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.
@@ -37,8 +38,13 @@
<dependencies>
<dependency>
- <groupId>org.powermock</groupId>
- <artifactId>powermock-api-mockito2</artifactId>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/integrity-monitor/src/test/java/org/onap/policy/common/im/AllSeemsWellTest.java b/integrity-monitor/src/test/java/org/onap/policy/common/im/AllSeemsWellTest.java
index a46be4f0..b5c15904 100644
--- a/integrity-monitor/src/test/java/org/onap/policy/common/im/AllSeemsWellTest.java
+++ b/integrity-monitor/src/test/java/org/onap/policy/common/im/AllSeemsWellTest.java
@@ -3,6 +3,7 @@
* Integrity Monitor
* ================================================================================
* Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
+ * Modificaitons 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.
@@ -33,9 +34,9 @@ import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
-import org.powermock.reflect.Whitebox;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.test.util.ReflectionTestUtils;
public class AllSeemsWellTest extends IntegrityMonitorTestBase {
private static final String ALL_SEEMS_WELL_MSG = "'AllSeemsWellTest - ALLSEEMSWELL'";
@@ -93,7 +94,7 @@ public class AllSeemsWellTest extends IntegrityMonitorTestBase {
}
};
- Whitebox.setInternalState(IntegrityMonitor.class, IM_INSTANCE_FIELD, im);
+ ReflectionTestUtils.setField(IntegrityMonitor.class, IM_INSTANCE_FIELD, im);
}
@After
diff --git a/integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTest.java b/integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTest.java
index 0def27e0..451a384c 100644
--- a/integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTest.java
+++ b/integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTest.java
@@ -3,6 +3,7 @@
* Integrity Monitor
* ================================================================================
* Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
+ * Modificaitons 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.
@@ -40,9 +41,9 @@ import org.junit.Test;
import org.onap.policy.common.im.jpa.ForwardProgressEntity;
import org.onap.policy.common.im.jpa.ResourceRegistrationEntity;
import org.onap.policy.common.im.jpa.StateManagementEntity;
-import org.powermock.reflect.Whitebox;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.test.util.ReflectionTestUtils;
/*
* All JUnits are designed to run in the local development environment
@@ -906,7 +907,7 @@ public class IntegrityMonitorTest extends IntegrityMonitorTestBase {
}
};
- Whitebox.setInternalState(IntegrityMonitor.class, IM_INSTANCE_FIELD, im);
+ ReflectionTestUtils.setField(IntegrityMonitor.class, IM_INSTANCE_FIELD, im);
// wait for the monitor thread to start
waitCycles(1);
diff --git a/integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTestBase.java b/integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTestBase.java
index c034482f..ffa45a25 100644
--- a/integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTestBase.java
+++ b/integrity-monitor/src/test/java/org/onap/policy/common/im/IntegrityMonitorTestBase.java
@@ -3,6 +3,7 @@
* Integrity Audit
* ================================================================================
* Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved.
+ * Modificaitons 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.
@@ -35,9 +36,9 @@ import org.onap.policy.common.utils.jpa.EntityTransCloser;
import org.onap.policy.common.utils.test.log.logback.ExtractAppender;
import org.onap.policy.common.utils.time.CurrentTime;
import org.onap.policy.common.utils.time.TestTime;
-import org.powermock.reflect.Whitebox;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.test.util.ReflectionTestUtils;
/**
* All JUnits are designed to run in the local development environment where they have write
@@ -153,7 +154,7 @@ public class IntegrityMonitorTestBase {
IntegrityMonitor.setUnitTesting(true);
testTime = new TestTime();
- Whitebox.setInternalState(MonitorTime.class, TIME_INSTANCE_FIELD, testTime);
+ ReflectionTestUtils.setField(MonitorTime.class, TIME_INSTANCE_FIELD, testTime);
properties = new Properties();
properties.put(IntegrityMonitorProperties.DB_DRIVER, DB_DRIVER);
@@ -187,7 +188,7 @@ public class IntegrityMonitorTestBase {
systemProps.put(JMX_PORT_PROP, savedJmxPort);
}
- Whitebox.setInternalState(MonitorTime.class, TIME_INSTANCE_FIELD, savedTime);
+ ReflectionTestUtils.setField(MonitorTime.class, TIME_INSTANCE_FIELD, savedTime);
IntegrityMonitor.setUnitTesting(false);