From 987b9f7a030a2389216c998225abb2602ef2dba3 Mon Sep 17 00:00:00 2001 From: liamfallon Date: Tue, 31 Jan 2023 10:39:50 +0000 Subject: 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: Iec5ba1283acd506c9f3c7fe7b5d7858db6abbaa7 Signed-off-by: liamfallon --- .../java/org/onap/policy/common/utils/io/SerializerTest.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'utils-test/src') 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); } /** -- cgit 1.2.3-korg