From e3938e43b8a1f02f74368ecb75c38530285feac0 Mon Sep 17 00:00:00 2001 From: liamfallon Date: Tue, 31 Jan 2023 10:41:01 +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: Ie8d6ee1e8bcdad282bcef3cad409c5c109e907f1 Signed-off-by: liamfallon --- .../onap/policy/models/sim/pdp/TestPdpSimulatorConstants.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'models-sim/policy-models-sim-pdp/src/test') diff --git a/models-sim/policy-models-sim-pdp/src/test/java/org/onap/policy/models/sim/pdp/TestPdpSimulatorConstants.java b/models-sim/policy-models-sim-pdp/src/test/java/org/onap/policy/models/sim/pdp/TestPdpSimulatorConstants.java index 491664498..10d7d9f68 100644 --- a/models-sim/policy-models-sim-pdp/src/test/java/org/onap/policy/models/sim/pdp/TestPdpSimulatorConstants.java +++ b/models-sim/policy-models-sim-pdp/src/test/java/org/onap/policy/models/sim/pdp/TestPdpSimulatorConstants.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. + * Copyright (C) 2019,2023 Nordix Foundation. * Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -23,8 +23,8 @@ package org.onap.policy.models.sim.pdp; import static org.assertj.core.api.Assertions.assertThatCode; +import java.lang.reflect.Constructor; import org.junit.Test; -import org.powermock.reflect.Whitebox; /** * Class to perform unit test of {@link PdpSimulatorConstants}}. @@ -35,6 +35,11 @@ public class TestPdpSimulatorConstants { @Test public void test() throws Exception { // verify that constructor does not throw an exception - assertThatCode(() -> Whitebox.invokeConstructor(PdpSimulatorConstants.class)).doesNotThrowAnyException(); + assertThatCode(() -> { + Constructor c = PdpSimulatorConstants.class.getDeclaredConstructor(); + c.setAccessible(true); + c.newInstance(); + } + ).doesNotThrowAnyException(); } } -- cgit 1.2.3-korg