summaryrefslogtreecommitdiffstats
path: root/utils-test
diff options
context:
space:
mode:
Diffstat (limited to 'utils-test')
-rw-r--r--utils-test/pom.xml10
-rw-r--r--utils-test/src/test/java/org/onap/policy/common/utils/io/SerializerTest.java9
2 files changed, 13 insertions, 6 deletions
diff --git a/utils-test/pom.xml b/utils-test/pom.xml
index fc16f837..99bda3e1 100644
--- a/utils-test/pom.xml
+++ b/utils-test/pom.xml
@@ -3,6 +3,7 @@
ONAP Policy Engine - Common Modules
================================================================================
Copyright (C) 2018-2021 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.
@@ -83,8 +84,13 @@
<version>${project.version}</version>
</dependency>
<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/utils-test/src/test/java/org/onap/policy/common/utils/io/SerializerTest.java b/utils-test/src/test/java/org/onap/policy/common/utils/io/SerializerTest.java
index b5699fa2..203c78ec 100644
--- a/utils-test/src/test/java/org/onap/policy/common/utils/io/SerializerTest.java
+++ b/utils-test/src/test/java/org/onap/policy/common/utils/io/SerializerTest.java
@@ -3,6 +3,7 @@
* ONAP Policy Engine - Common Modules
* ================================================================================
* Copyright (C) 2018-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.
@@ -41,7 +42,7 @@ import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.onap.policy.common.utils.io.Serializer.Factory;
-import org.powermock.reflect.Whitebox;
+import org.springframework.test.util.ReflectionTestUtils;
public class SerializerTest {
private static final String FACTORY = "factory";
@@ -53,12 +54,12 @@ public class SerializerTest {
@BeforeClass
public static void setUpBeforeClass() {
- saveFactory = Whitebox.getInternalState(Serializer.class, FACTORY);
+ saveFactory = (Factory) ReflectionTestUtils.getField(Serializer.class, FACTORY);
}
@AfterClass
public static void tearDownAfterClass() {
- Whitebox.setInternalState(Serializer.class, FACTORY, saveFactory);
+ ReflectionTestUtils.setField(Serializer.class, FACTORY, saveFactory);
}
@Before
@@ -376,7 +377,7 @@ public class SerializerTest {
* @param factory new factory to be set
*/
private void setFactory(Factory factory) {
- Whitebox.setInternalState(Serializer.class, FACTORY, factory);
+ ReflectionTestUtils.setField(Serializer.class, FACTORY, factory);
}
/**