From e37f5a70bcf3fd8073418c13416cc79c0ef47d59 Mon Sep 17 00:00:00 2001 From: HOCKLA Date: Fri, 17 Jan 2020 16:20:01 -0600 Subject: policy/engine jdk11 upgrades Issue-ID: POLICY-1590 Change-Id: I4da8324a065ac9babe16368e69b76a4cbe9504ef Signed-off-by: HOCKLA --- ONAP-PAP-REST/pom.xml | 26 +++++++++++++++++++--- .../onap/policy/pap/test/UpdateOthersPAPSTest.java | 9 +++++--- .../pap/xacml/rest/handler/DeleteHandlerTest.java | 9 +++++--- .../pap/xacml/rest/service/MetricServiceTest.java | 5 ++++- 4 files changed, 39 insertions(+), 10 deletions(-) (limited to 'ONAP-PAP-REST') diff --git a/ONAP-PAP-REST/pom.xml b/ONAP-PAP-REST/pom.xml index 33c6e84dc..111c24201 100644 --- a/ONAP-PAP-REST/pom.xml +++ b/ONAP-PAP-REST/pom.xml @@ -3,7 +3,7 @@ ============LICENSE_START======================================================= ONAP Policy Engine ================================================================================ - Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. + Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. Modifications Copyright (C) 2019 Nordix Foundation. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); @@ -54,8 +54,7 @@ org.apache.maven.plugins maven-compiler-plugin - 1.8 - 1.8 + ${java.version} @@ -114,6 +113,27 @@ javax.servlet javax.servlet-api + + javax.xml.bind + jaxb-api + ${version.javax.bind} + + + org.glassfish.jaxb + jaxb-runtime + 2.3.2 + test + + + javax.activation + javax.activation-api + 1.2.0 + + + javax.xml + jaxp-api + 1.4.2 + commons-logging commons-logging diff --git a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/test/UpdateOthersPAPSTest.java b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/test/UpdateOthersPAPSTest.java index ffac655a6..fcec4a652 100644 --- a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/test/UpdateOthersPAPSTest.java +++ b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/test/UpdateOthersPAPSTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP-PAP-REST * ================================================================================ - * Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; +import static org.mockito.ArgumentMatchers.anyString; import java.io.File; import java.util.ArrayList; @@ -35,7 +36,6 @@ import org.json.JSONObject; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.mockito.Matchers; import org.mockito.Mockito; import org.onap.policy.common.logging.flexlogger.FlexLogger; import org.onap.policy.common.logging.flexlogger.Logger; @@ -45,11 +45,14 @@ import org.onap.policy.pap.xacml.rest.components.Policy; import org.onap.policy.rest.dao.CommonClassDao; import org.onap.policy.rest.jpa.PolicyDbDaoEntity; import org.powermock.api.mockito.PowerMockito; +import org.powermock.core.classloader.annotations.PowerMockIgnore; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; import org.springframework.mock.web.MockHttpServletResponse; @RunWith(PowerMockRunner.class) +@PowerMockIgnore({"com.sun.org.apache.xalan.*", "com.sun.org.apache.xerces.*", "jdk.internal.reflect.*", "javax.xml.*", "org.xml.*", "org.w3c.*"}) +@PrepareForTest(UpdateOthersPAPS.class) public class UpdateOthersPAPSTest { private static Logger logger = FlexLogger.getLogger(UpdateOthersPAPSTest.class); @@ -110,7 +113,7 @@ public class UpdateOthersPAPSTest { when(Policy.getActionHome()).thenReturn("test"); File mockedFile = Mockito.mock(File.class); Mockito.when(mockedFile.exists()).thenReturn(true); - PowerMockito.whenNew(File.class).withParameterTypes(String.class).withArguments(Matchers.anyString()) + PowerMockito.whenNew(File.class).withParameterTypes(String.class).withArguments(anyString()) .thenReturn(mockedFile); updateOtherPaps.updateConfiguration(data, response); assertTrue(response.getStatus() == 200); diff --git a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/handler/DeleteHandlerTest.java b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/handler/DeleteHandlerTest.java index d0e4416f9..885230da4 100644 --- a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/handler/DeleteHandlerTest.java +++ b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/handler/DeleteHandlerTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP-PAP-REST * ================================================================================ - * Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,8 +24,8 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.eq; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.when; import com.mockrunner.mock.web.MockHttpServletRequest; @@ -51,10 +51,13 @@ import org.onap.policy.rest.jpa.PolicyVersion; import org.onap.policy.xacml.api.pap.PAPPolicyEngine; import org.onap.policy.xacml.std.pap.StdEngine; import org.powermock.api.mockito.PowerMockito; +import org.powermock.core.classloader.annotations.PowerMockIgnore; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; @RunWith(PowerMockRunner.class) +@PowerMockIgnore({"com.sun.org.apache.xerces.*", "jdk.internal.reflect.*", "javax.xml.*", "org.xml.*", "org.w3c.*"}) +@PrepareForTest(DeleteHandler.class) public class DeleteHandlerTest { @Before public void setUp() { diff --git a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/service/MetricServiceTest.java b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/service/MetricServiceTest.java index ebd3292aa..8136c8329 100644 --- a/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/service/MetricServiceTest.java +++ b/ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/service/MetricServiceTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP-PAP-REST * ================================================================================ - * Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,10 +35,13 @@ import org.onap.policy.pap.xacml.rest.XACMLPapServlet; import org.onap.policy.rest.dao.CommonClassDao; import org.onap.policy.rest.jpa.PolicyVersion; import org.powermock.api.mockito.PowerMockito; +import org.powermock.core.classloader.annotations.PowerMockIgnore; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; @RunWith(PowerMockRunner.class) +@PowerMockIgnore({"com.sun.org.apache.xerces.*", "jdk.internal.reflect.*", "javax.xml.*", "org.xml.*", "org.w3c.*"}) +@PrepareForTest(CommonClassDao.class) public class MetricServiceTest { @PrepareForTest({XACMLPapServlet.class}) @Test -- cgit 1.2.3-korg