policy/engine jdk11 upgrades 39/100439/2
authorHOCKLA <ah999m@att.com>
Fri, 17 Jan 2020 22:20:01 +0000 (16:20 -0600)
committerHOCKLA <ah999m@att.com>
Mon, 20 Jan 2020 16:34:32 +0000 (10:34 -0600)
Issue-ID: POLICY-1590
Change-Id: I4da8324a065ac9babe16368e69b76a4cbe9504ef
Signed-off-by: HOCKLA <ah999m@att.com>
30 files changed:
BRMSGateway/pom.xml
BRMSGateway/src/test/java/org/onap/policy/brms/BrmsPushTest.java
BRMSGateway/src/test/java/org/onap/policy/brms/api/BrmsHandlerTest.java
BRMSGateway/src/test/java/org/onap/policy/brms/api/BrmsPushTest.java
LogParser/pom.xml
LogParser/src/test/java/org/onap/xacml/parser/ParseLogTest.java
ONAP-PAP-REST/pom.xml
ONAP-PAP-REST/src/test/java/org/onap/policy/pap/test/UpdateOthersPAPSTest.java
ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/handler/DeleteHandlerTest.java
ONAP-PAP-REST/src/test/java/org/onap/policy/pap/xacml/rest/service/MetricServiceTest.java
ONAP-PDP-REST/src/test/java/org/onap/policy/pdp/rest/PapUrlResolverTest.java
ONAP-PDP-REST/src/test/java/org/onap/policy/pdp/rest/XACMLPdpServletTest.java
ONAP-PDP/checkstyle-suppressions.xml [new file with mode: 0644]
ONAP-PDP/pom.xml
ONAP-PDP/src/test/java/org/onap/policy/xacml/pdp/OnapPdpEngineFactoryTest.java
ONAP-SDK-APP/pom.xml
ONAP-XACML/pom.xml
POLICY-SDK-APP/pom.xml
POLICY-SDK-APP/src/test/java/org/onap/policy/admin/PolicyManagerServletTest.java
POLICY-SDK-APP/src/test/java/org/onap/policy/admin/PolicyRestControllerTest.java
POLICY-SDK-APP/src/test/java/org/onap/policy/controller/AdminTabControllerTest.java
POLICY-SDK-APP/src/test/java/org/onap/policy/controller/AutoPushControllerTest.java
POLICY-SDK-APP/src/test/java/org/onap/policy/controller/PolicyExportAndImportControllerTest.java
POLICY-SDK-APP/src/test/java/org/onap/policy/controller/PolicyNotificationControllerTest.java
POLICY-SDK-APP/src/test/java/org/onap/policy/daoImp/CommonClassDaoImplTest.java
POLICY-SDK-APP/src/test/java/org/onap/policy/daoImp/SystemLogDbDaoImplTest.java
PolicyEngineAPI/pom.xml
PolicyEngineAPI/src/test/java/org/onap/policy/std/StdPolicyEngineTest.java
packages/docker/src/main/docker/Dockerfile
pom.xml

index 5b344af..8f6a79d 100644 (file)
@@ -2,7 +2,7 @@
   ============LICENSE_START=======================================================
   ONAP Policy Engine
   ================================================================================
-  Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+  Copyright (C) 2017-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.
                             <configLocation>onap-checkstyle/onap-java-style.xml</configLocation>
                             <!-- <sourceDirectory> is needed so that checkstyle 
                                 ignores the generated sources directory -->
-                            <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
+                            <sourceDirectories>${project.build.sourceDirectory}</sourceDirectories>
                             <includeResources>true</includeResources>
                             <includeTestSourceDirectory>true</includeTestSourceDirectory>
                             <includeTestResources>true</includeTestResources>
                     <dependency>
                         <groupId>org.onap.oparent</groupId>
                         <artifactId>checkstyle</artifactId>
-                        <version>0.1.1</version>
+                        <version>${oparent.version}</version>
                         <scope>compile</scope>
                     </dependency>
                 </dependencies>
index de1a7d6..994e973 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP Policy Engine
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017, 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.
@@ -81,7 +81,7 @@ public class BrmsPushTest {
     }
 
     @Test(expected = PolicyException.class)
-    public void brmsHandlerFailTest2() throws PolicyException {
+    public void testBrmsHandlerFail2() throws PolicyException {
         final PropertyChange prop = new PropertyChange();
         prop.key = "defaultName";
         prop.remove = true;
@@ -92,7 +92,7 @@ public class BrmsPushTest {
     }
 
     @Test(expected = PolicyException.class)
-    public void brmsHandlerFailTest3() throws PolicyException {
+    public void testBrmsHandlerFail3() throws PolicyException {
         PropertyChange prop = new PropertyChange();
         prop.key = "repositoryID";
         prop.remove = true;
@@ -107,7 +107,7 @@ public class BrmsPushTest {
     }
 
     @Test(expected = PolicyException.class)
-    public void brmsHandlerFailTest4() throws PolicyException {
+    public void testBrmsHandlerFail4() throws PolicyException {
         final PropertyChange prop = new PropertyChange();
         prop.key = "repositoryURL";
         prop.remove = true;
@@ -118,7 +118,7 @@ public class BrmsPushTest {
     }
 
     @Test(expected = PolicyException.class)
-    public void brmsHandlerFailTest5() throws PolicyException {
+    public void testBrmsHandlerFail5() throws PolicyException {
         final PropertyChange prop = new PropertyChange();
         prop.key = "repositoryName";
         prop.remove = true;
@@ -129,7 +129,7 @@ public class BrmsPushTest {
     }
 
     @Test(expected = PolicyException.class)
-    public void brmsHandlerFailTest6() throws PolicyException {
+    public void testBrmsHandlerFail6() throws PolicyException {
         PropertyChange prop = new PropertyChange();
         prop.key = "repositoryURL";
         prop.value = "http://nexus:8081/nexus/content/repositories/releases,"
@@ -146,7 +146,7 @@ public class BrmsPushTest {
     }
 
     @Test(expected = PolicyException.class)
-    public void brmsHandlerFailTest7() throws PolicyException {
+    public void testBrmsHandlerFail7() throws PolicyException {
         final PropertyChange prop = new PropertyChange();
         prop.key = "repositoryPassword";
         prop.remove = true;
@@ -157,7 +157,7 @@ public class BrmsPushTest {
     }
 
     @Test(expected = PolicyException.class)
-    public void brmsHandlerFailTest8() throws PolicyException {
+    public void testBrmsHandlerFail8() throws PolicyException {
         final PropertyChange prop = new PropertyChange();
         prop.key = "policyKeyID";
         prop.remove = true;
@@ -168,7 +168,7 @@ public class BrmsPushTest {
     }
 
     @Test(expected = PolicyException.class)
-    public void brmsHandlerFailTest9() throws PolicyException {
+    public void testBrmsHandlerFail9() throws PolicyException {
         PropertyChange prop = new PropertyChange();
         prop.key = "sync";
         prop.value = "true";
@@ -188,7 +188,7 @@ public class BrmsPushTest {
     }
 
     @Test(expected = PolicyException.class)
-    public void brmsHandlerFailTest10() throws PolicyException {
+    public void testBrmsHandlerFail10() throws PolicyException {
         final PropertyChange prop = new PropertyChange();
         prop.key = "groupNames";
         prop.value = "";
@@ -200,7 +200,7 @@ public class BrmsPushTest {
     }
 
     @Test(expected = PolicyException.class)
-    public void brmsHandlerFailTest11() throws PolicyException {
+    public void testBrmsHandlerFail11() throws PolicyException {
         final PropertyChange prop = new PropertyChange();
         prop.key = "default.groupID";
         prop.remove = true;
@@ -211,7 +211,7 @@ public class BrmsPushTest {
     }
 
     @Test(expected = PolicyException.class)
-    public void brmsHandlerFailTest12() throws PolicyException {
+    public void testBrmsHandlerFail12() throws PolicyException {
         final PropertyChange prop = new PropertyChange();
         prop.key = "default.artifactID";
         prop.remove = true;
@@ -222,7 +222,7 @@ public class BrmsPushTest {
     }
 
     @Test(expected = PolicyException.class)
-    public void brmsHandlerFailTest13() throws PolicyException {
+    public void testBrmsHandlerFail13() throws PolicyException {
         PropertyChange prop = new PropertyChange();
         prop.key = "NOTIFICATION_TYPE";
         prop.value = "dmaap";
index 8fda22e..079db21 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP Policy Engine
  * ================================================================================
- * Copyright (C) 2018 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.
@@ -23,7 +23,7 @@ package org.onap.policy.brms.api;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.fail;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 
 import javax.persistence.EntityManager;
 import javax.persistence.EntityManagerFactory;
@@ -38,14 +38,16 @@ import org.onap.policy.api.NotificationType;
 import org.onap.policy.std.StdPDPNotification;
 import org.onap.policy.utils.BackUpMonitor;
 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({Persistence.class, BackUpMonitor.class})
 public class BrmsHandlerTest {
-    @PrepareForTest({Persistence.class, BackUpMonitor.class})
     @Test
-    public void negativeTestNotifications() throws Exception {
+    public void testNegativeTestNotifications() throws Exception {
         // Mock emf, persistence, and query
         final EntityManagerFactory emf = Mockito.mock(EntityManagerFactory.class);
         final EntityManager em = Mockito.mock(EntityManager.class);
index 4141a8b..3adc557 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP Policy Engine
  * ================================================================================
- * 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.
@@ -23,7 +23,7 @@ package org.onap.policy.brms.api;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.fail;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 
 import java.util.HashMap;
 import java.util.List;
@@ -46,15 +46,17 @@ import org.onap.policy.utils.BackUpHandler;
 import org.onap.policy.utils.BackUpMonitor;
 import org.onap.policy.utils.BackUpMonitorException;
 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({Persistence.class, BackUpMonitor.class})
 public class BrmsPushTest {
     @Rule
     public ExpectedException thrown = ExpectedException.none();
 
-    @PrepareForTest({Persistence.class, BackUpMonitor.class})
     @Test
     public void testPush() throws BackUpMonitorException, PolicyException {
         // Mock emf, persistence, and query
index b0281ba..24ebb6d 100644 (file)
@@ -3,7 +3,7 @@
   ============LICENSE_START=======================================================
   ONAP Policy Engine
   ================================================================================
-  Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+  Copyright (C) 2017-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.
                             <configLocation>onap-checkstyle/onap-java-style.xml</configLocation>
                             <!-- <sourceDirectory> is needed so that checkstyle ignores the generated 
                                 sources directory -->
-                            <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
+                            <sourceDirectories>${project.build.sourceDirectory}</sourceDirectories>
                             <includeResources>true</includeResources>
                             <includeTestSourceDirectory>true</includeTestSourceDirectory>
                             <includeTestResources>true</includeTestResources>
index 313750e..6609778 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * LogParser
  * ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-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.
@@ -47,11 +47,13 @@ import org.onap.policy.common.logging.flexlogger.FlexLogger;
 import org.onap.policy.common.logging.flexlogger.Logger;
 import org.onap.xacml.parser.LogEntryObject.LogType;
 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;
 
-@PrepareForTest({ ParseLogTest.class, IntegrityMonitor.class })
 @RunWith(PowerMockRunner.class)
+@PowerMockIgnore({"com.sun.org.apache.xerces.*", "jdk.internal.reflect.*", "javax.xml.*", "org.xml.*"})
+@PrepareForTest({ ParseLogTest.class, IntegrityMonitor.class })
 public class ParseLogTest {
 
     private static Logger logger = FlexLogger.getLogger(ParseLogTest.class);
index 33c6e84..111c242 100644 (file)
@@ -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 @@
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
                 <configuration>
-                    <source>1.8</source>
-                    <target>1.8</target>
+                    <release>${java.version}</release>
                 </configuration>
             </plugin>
         </plugins>
             <groupId>javax.servlet</groupId>
             <artifactId>javax.servlet-api</artifactId>
         </dependency>
+        <dependency>
+            <groupId>javax.xml.bind</groupId>
+            <artifactId>jaxb-api</artifactId>
+            <version>${version.javax.bind}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.glassfish.jaxb</groupId>
+            <artifactId>jaxb-runtime</artifactId>
+            <version>2.3.2</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>javax.activation</groupId>
+            <artifactId>javax.activation-api</artifactId>
+            <version>1.2.0</version>
+        </dependency>
+        <dependency>
+            <groupId>javax.xml</groupId>
+            <artifactId>jaxp-api</artifactId>
+            <version>1.4.2</version>
+        </dependency>
         <dependency>
             <groupId>commons-logging</groupId>
             <artifactId>commons-logging</artifactId>
index ffac655..fcec4a6 100644 (file)
@@ -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);
index d0e4416..885230d 100644 (file)
@@ -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() {
index ebd3292..8136c83 100644 (file)
@@ -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
index fb768f7..841fad6 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP-PDP-REST
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017, 2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Modifications Copyright (C) 2019 Samsung
  * ================================================================================
@@ -59,6 +59,9 @@ public class PapUrlResolverTest {
         succeeded = prop.getProperty(XacmlRestProperties.PROP_PAP_SUCCEEDED_URLS);
         rs = PapUrlResolver.getInstance(urls, failed, succeeded);
         Assert.assertTrue(rs.hasMoreUrls());
+        Assert.assertEquals("http://one.localhost.com", rs.getUrl());
+        rs.getNext();
+        Assert.assertTrue(rs.hasMoreUrls());
         Assert.assertEquals("http://two.localhost.com", rs.getUrl());
         rs.getNext();
         Assert.assertTrue(rs.hasMoreUrls());
@@ -66,9 +69,6 @@ public class PapUrlResolverTest {
         rs.getNext();
         Assert.assertTrue(rs.hasMoreUrls());
         Assert.assertEquals("http://four.localhost.com", rs.getUrl());
-        rs.getNext();
-        Assert.assertTrue(rs.hasMoreUrls());
-        Assert.assertEquals("http://one.localhost.com", rs.getUrl());
         rs.succeeded();
         rs.getNext();
         Assert.assertFalse(rs.hasMoreUrls());
@@ -128,13 +128,13 @@ public class PapUrlResolverTest {
         String succeeded = "-1,8/13/15 5:41 PM,8/13/15 4:41 PM,-1";
         PapUrlResolver rs = PapUrlResolver.getInstance(urls, failed, succeeded);
         Assert.assertTrue(rs.hasMoreUrls());
-        Assert.assertEquals("http://two.localhost.com", rs.getUrl());
+        Assert.assertEquals("http://one.localhost.com", rs.getUrl());
         rs.getNext();
         Assert.assertTrue(rs.hasMoreUrls());
-        Assert.assertEquals("http://three.localhost.com", rs.getUrl());
+        Assert.assertEquals("http://two.localhost.com", rs.getUrl());
         rs.getNext();
         Assert.assertTrue(rs.hasMoreUrls());
-        Assert.assertEquals("http://one.localhost.com", rs.getUrl());
+        Assert.assertEquals("http://three.localhost.com", rs.getUrl());
         rs.getNext();
         Assert.assertTrue(rs.hasMoreUrls());
         Assert.assertEquals("http://four.localhost.com", rs.getUrl());
@@ -186,13 +186,13 @@ public class PapUrlResolverTest {
         succeeded = "-1,-1,-1,-1";
         rs = PapUrlResolver.getInstance(urls, failed, succeeded);
         Assert.assertTrue(rs.hasMoreUrls());
-        Assert.assertEquals("http://two.localhost.com", rs.getUrl());
+        Assert.assertEquals("http://one.localhost.com", rs.getUrl());
         rs.getNext();
         Assert.assertTrue(rs.hasMoreUrls());
-        Assert.assertEquals("http://three.localhost.com", rs.getUrl());
+        Assert.assertEquals("http://two.localhost.com", rs.getUrl());
         rs.getNext();
         Assert.assertTrue(rs.hasMoreUrls());
-        Assert.assertEquals("http://one.localhost.com", rs.getUrl());
+        Assert.assertEquals("http://three.localhost.com", rs.getUrl());
         rs.getNext();
         Assert.assertTrue(rs.hasMoreUrls());
         Assert.assertEquals("http://four.localhost.com", rs.getUrl());
@@ -204,6 +204,9 @@ public class PapUrlResolverTest {
         succeeded = "-1,-1,-1,-1";
         rs = PapUrlResolver.getInstance(urls, failed, succeeded);
         Assert.assertTrue(rs.hasMoreUrls());
+        Assert.assertEquals("http://one.localhost.com", rs.getUrl());
+        rs.getNext();
+        Assert.assertTrue(rs.hasMoreUrls());
         Assert.assertEquals("http://two.localhost.com", rs.getUrl());
         rs.getNext();
         Assert.assertTrue(rs.hasMoreUrls());
@@ -212,9 +215,6 @@ public class PapUrlResolverTest {
         Assert.assertTrue(rs.hasMoreUrls());
         Assert.assertEquals("http://four.localhost.com", rs.getUrl());
         rs.getNext();
-        Assert.assertTrue(rs.hasMoreUrls());
-        Assert.assertEquals("http://one.localhost.com", rs.getUrl());
-        rs.getNext();
         Assert.assertFalse(rs.hasMoreUrls());
 
         urls = "http://one.localhost.com,http://two.localhost.com,http://three.localhost.com,http://four.localhost.com";
index 17601a2..eb6910c 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP-PDP-REST
  * ================================================================================
- * 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 Samsung
  * ================================================================================
@@ -47,6 +47,7 @@ import org.onap.policy.common.logging.flexlogger.Logger;
 import org.onap.policy.xacml.std.pap.StdPDPPolicy;
 import org.onap.policy.xacml.std.pap.StdPDPStatus;
 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;
@@ -56,6 +57,7 @@ import com.mockrunner.mock.web.MockServletInputStream;
 import junit.framework.TestCase;
 
 @RunWith(PowerMockRunner.class)
+@PowerMockIgnore({"com.sun.org.apache.xerces.*", "javax.xml.*", "org.xml.*", "javax.management.*", "org.w3c.dom.*"})
 @PrepareForTest({IntegrityMonitor.class})
 public class XACMLPdpServletTest extends TestCase {
     private static Logger LOGGER = FlexLogger.getLogger(XACMLPdpServletTest.class);
diff --git a/ONAP-PDP/checkstyle-suppressions.xml b/ONAP-PDP/checkstyle-suppressions.xml
new file mode 100644 (file)
index 0000000..ee01ae5
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+<!--
+  ============LICENSE_START=======================================================
+   Copyright (C) 2020 AT&T Technologies. 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.
+  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+  SPDX-License-Identifier: Apache-2.0
+  ============LICENSE_END=========================================================
+
+
+  **** NOTE ****
+  This file is needed to suppress checkstyle for properties files.
+  **************
+-->
+
+<!DOCTYPE suppressions PUBLIC
+     "-//Puppy Crawl//DTD Suppressions 1.0//EN"
+     "http://www.puppycrawl.com/dtds/suppressions_1_0.dtd">
+
+<suppressions>
+  <suppress files="\.properties" checks="[a-zA-Z0-9]*"/>
+</suppressions>
index 0442195..7613258 100644 (file)
@@ -3,7 +3,7 @@
   ============LICENSE_START=======================================================
   ONAP Policy Engine
   ================================================================================
-  Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+  Copyright (C) 2017-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.
                             <configLocation>onap-checkstyle/onap-java-style.xml</configLocation>
                             <!-- <sourceDirectory> is needed so that checkstyle ignores the generated 
                                 sources directory -->
-                            <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
+                            <sourceDirectories>${project.build.sourceDirectory}</sourceDirectories>
                             <includeResources>true</includeResources>
                             <includeTestSourceDirectory>true</includeTestSourceDirectory>
                             <includeTestResources>true</includeTestResources>
                             <excludes>
                             </excludes>
+                            <suppressionsLocation>/checkstyle-suppressions.xml</suppressionsLocation>
                             <consoleOutput>true</consoleOutput>
                             <failOnViolation>true</failOnViolation>
                             <violationSeverity>warning</violationSeverity>
index d3ee544..9447a95 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP-PDP
  * ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-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.
@@ -33,10 +33,13 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Mockito;
 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.*"})
+@PrepareForTest(OnapPdpEngineFactory.class)
 public class OnapPdpEngineFactoryTest {
     @Test
     public final void testNewEngine() {
@@ -61,7 +64,7 @@ public class OnapPdpEngineFactoryTest {
 
     @PrepareForTest({ EvaluationContextFactory.class, FactoryFinder.class })
     @Test(expected = FactoryException.class)
-    public void negTestEngine() throws FactoryException {
+    public void testNegTestEngine() throws FactoryException {
         // Setup test data
         PowerMockito.mockStatic(FactoryFinder.class);
         PowerMockito.when(FactoryFinder.find(Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(null);
@@ -74,7 +77,7 @@ public class OnapPdpEngineFactoryTest {
 
     @PrepareForTest({ EvaluationContextFactory.class, FactoryFinder.class })
     @Test(expected = FactoryException.class)
-    public void negTestEngine2() throws FactoryException {
+    public void testNegTestEngine2() throws FactoryException {
         // Setup test data
         PowerMockito.mockStatic(FactoryFinder.class);
         PowerMockito.when(FactoryFinder.find(Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(null);
index 240ee7f..fa41d92 100644 (file)
@@ -2,7 +2,7 @@
   ============LICENSE_START=======================================================
   ONAP Policy Engine
   ================================================================================
-  Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+  Copyright (C) 2017-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.
         </plugins>
     </build>
     <dependencies>
+        <dependency>
+            <groupId>org.powermock</groupId>
+            <artifactId>powermock-api-mockito2</artifactId>
+            <scope>test</scope>
+        </dependency>
         <!-- Policy overlay war -->
         <dependency>
             <groupId>org.onap.policy.engine</groupId>
index 75bf1c0..8bb78f6 100644 (file)
@@ -3,7 +3,7 @@
   ============LICENSE_START=======================================================
   ONAP Policy Engine
   ================================================================================
-  Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+  Copyright (C) 2017-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.
             <groupId>org.apache.httpcomponents</groupId>
             <artifactId>httpcore</artifactId>
         </dependency>
+        <dependency>
+            <groupId>javax.xml.bind</groupId>
+            <artifactId>jaxb-api</artifactId>
+            <version>${version.javax.bind}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.glassfish.jaxb</groupId>
+            <artifactId>jaxb-runtime</artifactId>
+            <version>2.3.2</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>javax.activation</groupId>
+            <artifactId>javax.activation-api</artifactId>
+            <version>1.2.0</version>
+        </dependency>
+        <dependency>
+            <groupId>javax.xml</groupId>
+            <artifactId>jaxp-api</artifactId>
+            <version>1.4.2</version>
+        </dependency>
+        <dependency>
+            <groupId>javax.xml.parsers</groupId>
+            <artifactId>jaxp-api</artifactId>
+            <version>1.4.5</version>
+        </dependency>
         <dependency>
             <groupId>com.att.research.xacml</groupId>
             <artifactId>xacml</artifactId>
index 6a98e0f..9c8716b 100644 (file)
@@ -2,7 +2,7 @@
   ============LICENSE_START=======================================================
   ONAP Policy Engine
   ================================================================================
-  Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+  Copyright (C) 2017-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.
         <sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**,src/main/webapp/app/policyApp/CSS/**/*,src/main/webapp/app/policyApp/libs.bower_components/**/*</sonar.exclusions>
     </properties>
     <dependencies>
+        <dependency>
+            <groupId>org.powermock</groupId>
+            <artifactId>powermock-api-mockito2</artifactId>
+            <scope>test</scope>
+        </dependency>
         <dependency>
             <groupId>ch.qos.logback</groupId>
             <artifactId>logback-classic</artifactId>
index d8c691a..cf85186 100644 (file)
@@ -73,12 +73,14 @@ import org.onap.portalsdk.core.domain.User;
 import org.onap.portalsdk.core.util.SystemProperties;
 import org.onap.portalsdk.core.web.support.UserUtils;
 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.powermock.reflect.Whitebox;
 import org.springframework.mock.web.MockHttpServletResponse;
 
 @RunWith(PowerMockRunner.class)
+@PowerMockIgnore({"com.sun.org.apache.xerces.*", "jdk.internal.reflect.*", "javax.xml.*", "org.xml.*", "org.w3c.*"})
 public class PolicyManagerServletTest extends Mockito {
 
     private static Logger logger = FlexLogger.getLogger(PolicyManagerServletTest.class);
@@ -834,7 +836,6 @@ public class PolicyManagerServletTest extends Mockito {
         PowerMockito.mockStatic(ServletFileUpload.class);
         when(ServletFileUpload.isMultipartContent(mockRequest)).thenReturn(true);
         servlet.doPost(mockRequest, mockResponse);
-        PowerMockito.verifyStatic(ServletFileUpload.class, Mockito.times(1));
     }
 
     @SuppressWarnings("unchecked")
@@ -939,9 +940,9 @@ public class PolicyManagerServletTest extends Mockito {
                 mockPolicyController, resultList);
 
         assertTrue(result);
-        verify(mockPolicyController, atLeast(1)).getRoles(any(String.class));
-        verify(mockPolicyController, atLeast(1)).getRoles(any(String.class));
-        verify(mockPolicyController, atLeast(1)).getData(any(Class.class));
+        verify(mockPolicyController, atLeast(1)).getRoles(any());
+        verify(mockPolicyController, atLeast(1)).getRoles(any());
+        verify(mockPolicyController, atLeast(1)).getData(any());
         verify(mockPolicyController, atLeast(1)).getEntityItem(UserInfo.class, "userLoginId", "sampleUserName");
         verify(mockPolicyVersion, atLeast(1)).getPolicyName();
         verify(mockPolicyVersion, atLeast(1)).getModifiedDate();
index be38e79..b2e1b92 100644 (file)
@@ -62,12 +62,14 @@ import org.onap.portalsdk.core.domain.User;
 import org.onap.portalsdk.core.util.SystemProperties;
 import org.onap.portalsdk.core.web.support.UserUtils;
 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.powermock.reflect.Whitebox;
 import org.springframework.mock.web.MockHttpServletResponse;
 
 @RunWith(PowerMockRunner.class)
+@PowerMockIgnore({"com.sun.org.apache.xerces.*", "jdk.internal.reflect.*", "javax.xml.*", "org.xml.*", "org.w3c.*"})
 public class PolicyRestControllerTest {
 
     private String clRequestString;
index b4a4130..eccab04 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP Policy Engine
  * ================================================================================
- * Copyright (C) 2017, 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017, 2019-2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Modifications Copyright (C) 2019 Samsung
  * ================================================================================
@@ -115,7 +115,7 @@ public class AdminTabControllerTest {
     @Test
     public void testGetAdminTabEntityDataException() throws IOException {
         HttpServletResponse mockResponse = Mockito.mock(HttpServletResponse.class);
-        when(mockResponse.getWriter()).thenThrow(Exception.class);
+        when(mockResponse.getWriter()).thenThrow(IOException.class);
         admin.getAdminTabEntityData(request, mockResponse);
         verify(mockResponse).getWriter();
     }
index 5e390da..95d5662 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP Policy Engine
  * ================================================================================
- * Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Modifications Copyright (C) 2019 Samsung
  * ================================================================================
@@ -24,7 +24,7 @@ package org.onap.policy.controller;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.atLeast;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
@@ -53,10 +53,12 @@ import org.onap.portalsdk.core.domain.User;
 import org.onap.portalsdk.core.web.support.AppUtils;
 import org.onap.portalsdk.core.web.support.UserUtils;
 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.*"})
 public class AutoPushControllerTest {
     private PolicyController controller = new PolicyController();
     private AutoPushController apController = new AutoPushController();
index 84e9ccf..4b348cf 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP Policy Engine
  * ================================================================================
- * 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.
@@ -23,8 +23,8 @@ package org.onap.policy.controller;
 import static org.junit.Assert.assertEquals;
 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;
@@ -48,10 +48,12 @@ import org.onap.policy.rest.jpa.UserInfo;
 import org.onap.portalsdk.core.domain.User;
 import org.onap.portalsdk.core.web.support.UserUtils;
 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.*"})
 public class PolicyExportAndImportControllerTest {
     @Test
     public void testSetAndGet() {
index 509f4a6..31b2dff 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP Policy Engine
  * ================================================================================
- * Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Modifications Copyright (C) 2019 Samsung
  * ================================================================================
@@ -24,7 +24,7 @@ package org.onap.policy.controller;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.when;
 
 import com.mockrunner.mock.web.MockHttpServletRequest;
@@ -42,13 +42,15 @@ import org.onap.policy.rest.dao.CommonClassDao;
 import org.onap.portalsdk.core.domain.User;
 import org.onap.portalsdk.core.web.support.UserUtils;
 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.web.servlet.ModelAndView;
 
 @RunWith(PowerMockRunner.class)
+@PowerMockIgnore({"com.sun.org.apache.xerces.*", "jdk.internal.reflect.*", "javax.xml.*", "org.xml.*", "org.w3c.*"})
+@PrepareForTest({UserUtils.class})
 public class PolicyNotificationControllerTest {
-    @PrepareForTest({UserUtils.class})
     @Test
     public void testWatch() throws IOException {
         // Mock user utilities
index dbe49c7..2b10520 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP Policy Engine
  * ================================================================================
- * Copyright (C) 2017, 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017, 2019-2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Modifications Copyright (C) 2019 Samsung
  * ================================================================================
@@ -40,6 +40,7 @@ import javax.script.SimpleBindings;
 import org.apache.tomcat.dbcp.dbcp2.BasicDataSource;
 import org.h2.tools.Server;
 import org.hibernate.Criteria;
+import org.hibernate.HibernateException;
 import org.hibernate.Session;
 import org.hibernate.SessionFactory;
 import org.hibernate.Transaction;
@@ -463,7 +464,7 @@ public class CommonClassDaoImplTest {
 
     @SuppressWarnings("unchecked")
     @Test
-    public void testExceptions() {
+    public void testExceptions() throws HibernateException {
         SessionFactory sfMock = Mockito.mock(SessionFactory.class);
         Session mockSession = Mockito.mock(Session.class);
         Criteria crMock = Mockito.mock(Criteria.class);
@@ -474,11 +475,11 @@ public class CommonClassDaoImplTest {
         when(sfMock.openSession()).thenReturn(mockSession);
         when(mockSession.createCriteria(OnapName.class)).thenReturn(crMock);
 
-        when(crMock.list()).thenThrow(Exception.class);
-        when(mockSession.close()).thenThrow(Exception.class);
+        when(crMock.list()).thenThrow(HibernateException.class);
+        when(mockSession.close()).thenThrow(HibernateException.class);
 
         when(mockSession.beginTransaction()).thenReturn(mockTransaction);
-        doThrow(Exception.class).when(mockTransaction).commit();
+        doThrow(HibernateException.class).when(mockTransaction).commit();
 
         List<?> dataList = commonClassDao.getData(OnapName.class);
         assertNull(dataList);
index 5675d3f..44f034c 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP Policy Engine
  * ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-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.
@@ -25,6 +25,8 @@ import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.when;
 
 import java.util.List;
+
+import org.hibernate.HibernateException;
 import org.hibernate.Session;
 import org.hibernate.SessionFactory;
 import org.hibernate.Transaction;
@@ -50,8 +52,8 @@ public class SystemLogDbDaoImplTest {
         when(sfMock.openSession()).thenReturn(mockSession);
         when(mockSession.beginTransaction()).thenReturn(mockTransaction);
 
-        doThrow(Exception.class).when(mockTransaction).commit();
-        when(mockSession.close()).thenThrow(Exception.class);
+        doThrow(HibernateException.class).when(mockTransaction).commit();
+        when(mockSession.close()).thenThrow(HibernateException.class);
 
         PolicyController.setjUnit(true);
     }
index 6bde8fb..94c06b7 100644 (file)
@@ -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.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
         <dependency>
             <groupId>org.glassfish</groupId>
             <artifactId>javax.json</artifactId>
-            <version>1.0.4</version>
+            <version>1.1.4</version>
+        </dependency>
+        <dependency>
+            <groupId>javax.xml.bind</groupId>
+            <artifactId>jaxb-api</artifactId>
+            <version>${version.javax.bind}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.glassfish.jaxb</groupId>
+            <artifactId>jaxb-runtime</artifactId>
+            <version>2.3.2</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>javax.activation</groupId>
+            <artifactId>javax.activation-api</artifactId>
+            <version>1.2.0</version>
+        </dependency>
+        <dependency>
+            <groupId>javax.xml.ws</groupId>
+            <artifactId>jaxws-api</artifactId>
+            <version>2.3.1</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>javax.xml</groupId>
+            <artifactId>jaxp-api</artifactId>
+            <version>1.4.2</version>
+        </dependency>
+        <dependency>
+            <groupId>javax.xml.parsers</groupId>
+            <artifactId>jaxp-api</artifactId>
+            <version>1.4.5</version>
         </dependency>
         <dependency>
             <groupId>org.apache.httpcomponents</groupId>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
                 <configuration>
-                    <source>1.8</source>
-                    <target>1.8</target>
+                    <release>${java.version}</release>
                 </configuration>
             </plugin>
             <plugin>
index 90e00c2..a7f6099 100644 (file)
@@ -5,6 +5,7 @@
  * Copyright (C) 2018 Ericsson. All rights reserved.
  * ================================================================================
  * Modifications Copyright (C) 2019 Samsung
+ * Modifications Copyright (C) 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 +25,8 @@ package org.onap.policy.std;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
-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.doReturn;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.spy;
@@ -103,6 +104,8 @@ import org.onap.policy.api.PushPolicyParameters;
 import org.onap.policy.models.APIDictionaryResponse;
 import org.onap.policy.models.APIPolicyConfigResponse;
 import org.onap.policy.std.utils.PolicyConfigConstants;
+import org.powermock.core.classloader.annotations.PowerMockIgnore;
+import org.powermock.core.classloader.annotations.PrepareForTest;
 import org.powermock.modules.junit4.PowerMockRunner;
 import org.springframework.http.HttpMethod;
 import org.springframework.http.HttpStatus;
@@ -111,6 +114,8 @@ import org.springframework.web.client.HttpClientErrorException;
 import org.springframework.web.client.RestClientException;
 
 @RunWith(PowerMockRunner.class)
+@PowerMockIgnore({"com.sun.org.apache.xerces.*", "jdk.internal.reflect.*", "javax.xml.*", "org.xml.*", "org.w3c.*"})
+@PrepareForTest(StdPolicyEngine.class)
 public class StdPolicyEngineTest {
 
     private static final String ONAP_NAME_VAL = "ONAP_NAME";
index 7ef47b4..580becc 100644 (file)
@@ -1,4 +1,4 @@
-FROM onap/policy-common-alpine:1.4.0
+FROM onap/policy-jdk-debian
 
 LABEL maintainer="Policy Team"
 
@@ -8,9 +8,9 @@ ARG POLICY_LOGS=/var/log/onap
 ENV BUILD_VERSION_ENGINE ${BUILD_VERSION_ENGINE}
 ENV POLICY_LOGS ${POLICY_LOGS}
 
-RUN apk add --no-cache mariadb-client
-
-RUN mkdir -p /tmp/policy-install ${POLICY_LOGS} && \
+RUN apt update && \
+    apt-get install -y mariadb-client && \
+    mkdir -p /tmp/policy-install ${POLICY_LOGS} && \
     chown policy:policy /tmp/policy-install ${POLICY_LOGS} && \
     rmdir ${POLICY_HOME}/etc/ssl && \
     rmdir ${POLICY_HOME}/etc
diff --git a/pom.xml b/pom.xml
index 893a2fc..8541ee2 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.onap.policy.parent</groupId>
         <artifactId>integration</artifactId>
-        <version>3.1.0</version>
+        <version>3.1.1-SNAPSHOT</version>
         <relativePath />
     </parent>
     <groupId>org.onap.policy.engine</groupId>
@@ -35,8 +35,6 @@
     <description>The ONAP Policy Engine main pom</description>
     <properties>
         <!-- Project common build settings -->
-        <project.source.version>1.8</project.source.version>
-        <project.target.version>1.8</project.target.version>
         <project.encoding>UTF-8</project.encoding>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <!-- Project path properties -->
@@ -60,8 +58,8 @@
         <commons.fileupload.version>1.3.3</commons.fileupload.version>
         <commons.compress.version>1.18</commons.compress.version>
         <elasticsearch.version>6.8.2</elasticsearch.version>
-        <version.policy.common>1.6.1</version.policy.common>
-        <version.policy.models>2.2.0</version.policy.models>
+        <version.policy.common>1.6.2-SNAPSHOT</version.policy.common>
+        <version.policy.models>2.2.1-SNAPSHOT</version.policy.models>
     </properties>
     <modules>
         <module>PolicyEngineUtils</module>
             <!-- org.w3c.dom dependencies -->
             <groupId>xml-apis</groupId>
             <artifactId>xml-apis</artifactId>
-            <version>1.3.03</version>
+            <version>1.4.01</version>
         </dependency>
         <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
         <dependency>
         <!-- https://mvnrepository.com/artifact/org.powermock/powermock-api-mockito -->
         <dependency>
             <groupId>org.powermock</groupId>
-            <artifactId>powermock-api-mockito</artifactId>
+            <artifactId>powermock-api-mockito2</artifactId>
             <scope>test</scope>
         </dependency>
         <dependency>
         <dependency>
             <groupId>org.easymock</groupId>
             <artifactId>easymock</artifactId>
-            <version>3.1</version>
+            <version>4.1</version>
             <scope>test</scope>
         </dependency>
         <dependency>
                 <artifactId>maven-compiler-plugin</artifactId>
                 <configuration>
                     <encoding>${project.encoding}</encoding>
-                    <source>${project.source.version}</source>
-                    <target>${project.target.version}</target>
+                    <release>${java.version}</release>
                 </configuration>
             </plugin>
             <plugin>