policy/engine jdk11 upgrades
Issue-ID: POLICY-1590
Change-Id: I4da8324a065ac9babe16368e69b76a4cbe9504ef
Signed-off-by: HOCKLA <ah999m@att.com>
diff --git a/BRMSGateway/pom.xml b/BRMSGateway/pom.xml
index 5b344af..8f6a79d 100644
--- a/BRMSGateway/pom.xml
+++ b/BRMSGateway/pom.xml
@@ -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.
@@ -109,7 +109,7 @@
<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>
@@ -123,7 +123,7 @@
<dependency>
<groupId>org.onap.oparent</groupId>
<artifactId>checkstyle</artifactId>
- <version>0.1.1</version>
+ <version>${oparent.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
diff --git a/BRMSGateway/src/test/java/org/onap/policy/brms/BrmsPushTest.java b/BRMSGateway/src/test/java/org/onap/policy/brms/BrmsPushTest.java
index de1a7d6..994e973 100644
--- a/BRMSGateway/src/test/java/org/onap/policy/brms/BrmsPushTest.java
+++ b/BRMSGateway/src/test/java/org/onap/policy/brms/BrmsPushTest.java
@@ -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 @@
}
@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 @@
}
@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 @@
}
@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 @@
}
@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 @@
}
@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 @@
}
@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 @@
}
@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 @@
}
@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 @@
}
@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 @@
}
@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 @@
}
@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 @@
}
@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";
diff --git a/BRMSGateway/src/test/java/org/onap/policy/brms/api/BrmsHandlerTest.java b/BRMSGateway/src/test/java/org/onap/policy/brms/api/BrmsHandlerTest.java
index 8fda22e..079db21 100644
--- a/BRMSGateway/src/test/java/org/onap/policy/brms/api/BrmsHandlerTest.java
+++ b/BRMSGateway/src/test/java/org/onap/policy/brms/api/BrmsHandlerTest.java
@@ -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 @@
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.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);
diff --git a/BRMSGateway/src/test/java/org/onap/policy/brms/api/BrmsPushTest.java b/BRMSGateway/src/test/java/org/onap/policy/brms/api/BrmsPushTest.java
index 4141a8b..3adc557 100644
--- a/BRMSGateway/src/test/java/org/onap/policy/brms/api/BrmsPushTest.java
+++ b/BRMSGateway/src/test/java/org/onap/policy/brms/api/BrmsPushTest.java
@@ -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 @@
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.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
diff --git a/LogParser/pom.xml b/LogParser/pom.xml
index b0281ba..24ebb6d 100644
--- a/LogParser/pom.xml
+++ b/LogParser/pom.xml
@@ -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.
@@ -135,7 +135,7 @@
<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>
diff --git a/LogParser/src/test/java/org/onap/xacml/parser/ParseLogTest.java b/LogParser/src/test/java/org/onap/xacml/parser/ParseLogTest.java
index 313750e..6609778 100644
--- a/LogParser/src/test/java/org/onap/xacml/parser/ParseLogTest.java
+++ b/LogParser/src/test/java/org/onap/xacml/parser/ParseLogTest.java
@@ -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.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);
diff --git a/ONAP-PAP-REST/pom.xml b/ONAP-PAP-REST/pom.xml
index 33c6e84..111c242 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 @@
<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>
@@ -115,6 +114,27 @@
<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>
<version>1.1.3</version>
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 ffac655..fcec4a6 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.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.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.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 @@
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 d0e4416..885230d 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.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.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 ebd3292..8136c83 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.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
diff --git a/ONAP-PDP-REST/src/test/java/org/onap/policy/pdp/rest/PapUrlResolverTest.java b/ONAP-PDP-REST/src/test/java/org/onap/policy/pdp/rest/PapUrlResolverTest.java
index fb768f7..841fad6 100644
--- a/ONAP-PDP-REST/src/test/java/org/onap/policy/pdp/rest/PapUrlResolverTest.java
+++ b/ONAP-PDP-REST/src/test/java/org/onap/policy/pdp/rest/PapUrlResolverTest.java
@@ -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 @@
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 @@
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,15 +128,15 @@
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://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());
Assert.assertEquals("http://three.localhost.com", rs.getUrl());
rs.getNext();
Assert.assertTrue(rs.hasMoreUrls());
- Assert.assertEquals("http://one.localhost.com", rs.getUrl());
- rs.getNext();
- Assert.assertTrue(rs.hasMoreUrls());
Assert.assertEquals("http://four.localhost.com", rs.getUrl());
rs.getNext();
Assert.assertFalse(rs.hasMoreUrls());
@@ -186,15 +186,15 @@
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());
Assert.assertEquals("http://three.localhost.com", rs.getUrl());
rs.getNext();
Assert.assertTrue(rs.hasMoreUrls());
- Assert.assertEquals("http://one.localhost.com", rs.getUrl());
- rs.getNext();
- Assert.assertTrue(rs.hasMoreUrls());
Assert.assertEquals("http://four.localhost.com", rs.getUrl());
rs.getNext();
Assert.assertFalse(rs.hasMoreUrls());
@@ -204,6 +204,9 @@
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 @@
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";
diff --git a/ONAP-PDP-REST/src/test/java/org/onap/policy/pdp/rest/XACMLPdpServletTest.java b/ONAP-PDP-REST/src/test/java/org/onap/policy/pdp/rest/XACMLPdpServletTest.java
index 17601a2..eb6910c 100644
--- a/ONAP-PDP-REST/src/test/java/org/onap/policy/pdp/rest/XACMLPdpServletTest.java
+++ b/ONAP-PDP-REST/src/test/java/org/onap/policy/pdp/rest/XACMLPdpServletTest.java
@@ -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.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 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
index 0000000..ee01ae5
--- /dev/null
+++ b/ONAP-PDP/checkstyle-suppressions.xml
@@ -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>
diff --git a/ONAP-PDP/pom.xml b/ONAP-PDP/pom.xml
index 0442195..7613258 100644
--- a/ONAP-PDP/pom.xml
+++ b/ONAP-PDP/pom.xml
@@ -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.
@@ -99,12 +99,13 @@
<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>
diff --git a/ONAP-PDP/src/test/java/org/onap/policy/xacml/pdp/OnapPdpEngineFactoryTest.java b/ONAP-PDP/src/test/java/org/onap/policy/xacml/pdp/OnapPdpEngineFactoryTest.java
index d3ee544..9447a95 100644
--- a/ONAP-PDP/src/test/java/org/onap/policy/xacml/pdp/OnapPdpEngineFactoryTest.java
+++ b/ONAP-PDP/src/test/java/org/onap/policy/xacml/pdp/OnapPdpEngineFactoryTest.java
@@ -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.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 @@
@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 @@
@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);
diff --git a/ONAP-SDK-APP/pom.xml b/ONAP-SDK-APP/pom.xml
index 240ee7f..fa41d92 100644
--- a/ONAP-SDK-APP/pom.xml
+++ b/ONAP-SDK-APP/pom.xml
@@ -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.
@@ -185,6 +185,11 @@
</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>
diff --git a/ONAP-XACML/pom.xml b/ONAP-XACML/pom.xml
index 75bf1c0..8bb78f6 100644
--- a/ONAP-XACML/pom.xml
+++ b/ONAP-XACML/pom.xml
@@ -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.
@@ -48,6 +48,32 @@
<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>
<version>1.0.2</version>
diff --git a/POLICY-SDK-APP/pom.xml b/POLICY-SDK-APP/pom.xml
index 6a98e0f..9c8716b 100644
--- a/POLICY-SDK-APP/pom.xml
+++ b/POLICY-SDK-APP/pom.xml
@@ -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.
@@ -75,6 +75,11 @@
</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>
</dependency>
diff --git a/POLICY-SDK-APP/src/test/java/org/onap/policy/admin/PolicyManagerServletTest.java b/POLICY-SDK-APP/src/test/java/org/onap/policy/admin/PolicyManagerServletTest.java
index d8c691a..cf85186 100644
--- a/POLICY-SDK-APP/src/test/java/org/onap/policy/admin/PolicyManagerServletTest.java
+++ b/POLICY-SDK-APP/src/test/java/org/onap/policy/admin/PolicyManagerServletTest.java
@@ -73,12 +73,14 @@
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 @@
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 @@
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();
diff --git a/POLICY-SDK-APP/src/test/java/org/onap/policy/admin/PolicyRestControllerTest.java b/POLICY-SDK-APP/src/test/java/org/onap/policy/admin/PolicyRestControllerTest.java
index be38e79..b2e1b92 100644
--- a/POLICY-SDK-APP/src/test/java/org/onap/policy/admin/PolicyRestControllerTest.java
+++ b/POLICY-SDK-APP/src/test/java/org/onap/policy/admin/PolicyRestControllerTest.java
@@ -62,12 +62,14 @@
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;
diff --git a/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/AdminTabControllerTest.java b/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/AdminTabControllerTest.java
index b4a4130..eccab04 100644
--- a/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/AdminTabControllerTest.java
+++ b/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/AdminTabControllerTest.java
@@ -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 @@
@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();
}
diff --git a/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/AutoPushControllerTest.java b/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/AutoPushControllerTest.java
index 5e390da..95d5662 100644
--- a/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/AutoPushControllerTest.java
+++ b/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/AutoPushControllerTest.java
@@ -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 @@
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.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();
diff --git a/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/PolicyExportAndImportControllerTest.java b/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/PolicyExportAndImportControllerTest.java
index 84e9ccf..4b348cf 100644
--- a/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/PolicyExportAndImportControllerTest.java
+++ b/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/PolicyExportAndImportControllerTest.java
@@ -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 @@
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.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() {
diff --git a/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/PolicyNotificationControllerTest.java b/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/PolicyNotificationControllerTest.java
index 509f4a6..31b2dff 100644
--- a/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/PolicyNotificationControllerTest.java
+++ b/POLICY-SDK-APP/src/test/java/org/onap/policy/controller/PolicyNotificationControllerTest.java
@@ -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 @@
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.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
diff --git a/POLICY-SDK-APP/src/test/java/org/onap/policy/daoImp/CommonClassDaoImplTest.java b/POLICY-SDK-APP/src/test/java/org/onap/policy/daoImp/CommonClassDaoImplTest.java
index dbe49c7..2b10520 100644
--- a/POLICY-SDK-APP/src/test/java/org/onap/policy/daoImp/CommonClassDaoImplTest.java
+++ b/POLICY-SDK-APP/src/test/java/org/onap/policy/daoImp/CommonClassDaoImplTest.java
@@ -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 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 @@
@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 @@
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);
diff --git a/POLICY-SDK-APP/src/test/java/org/onap/policy/daoImp/SystemLogDbDaoImplTest.java b/POLICY-SDK-APP/src/test/java/org/onap/policy/daoImp/SystemLogDbDaoImplTest.java
index 5675d3f..44f034c 100644
--- a/POLICY-SDK-APP/src/test/java/org/onap/policy/daoImp/SystemLogDbDaoImplTest.java
+++ b/POLICY-SDK-APP/src/test/java/org/onap/policy/daoImp/SystemLogDbDaoImplTest.java
@@ -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.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 @@
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);
}
diff --git a/PolicyEngineAPI/pom.xml b/PolicyEngineAPI/pom.xml
index 6bde8fb..94c06b7 100644
--- a/PolicyEngineAPI/pom.xml
+++ b/PolicyEngineAPI/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.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -31,7 +31,39 @@
<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>
@@ -90,8 +122,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>
<plugin>
diff --git a/PolicyEngineAPI/src/test/java/org/onap/policy/std/StdPolicyEngineTest.java b/PolicyEngineAPI/src/test/java/org/onap/policy/std/StdPolicyEngineTest.java
index 90e00c2..a7f6099 100644
--- a/PolicyEngineAPI/src/test/java/org/onap/policy/std/StdPolicyEngineTest.java
+++ b/PolicyEngineAPI/src/test/java/org/onap/policy/std/StdPolicyEngineTest.java
@@ -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 @@
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.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.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";
diff --git a/packages/docker/src/main/docker/Dockerfile b/packages/docker/src/main/docker/Dockerfile
index 7ef47b4..580becc 100644
--- a/packages/docker/src/main/docker/Dockerfile
+++ b/packages/docker/src/main/docker/Dockerfile
@@ -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 @@
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
--- 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>
@@ -113,7 +111,7 @@
<!-- 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>
@@ -146,7 +144,7 @@
<!-- 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>
@@ -163,7 +161,7 @@
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
- <version>3.1</version>
+ <version>4.1</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -221,8 +219,7 @@
<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>