diff options
Diffstat (limited to 'main')
23 files changed, 93 insertions, 87 deletions
diff --git a/main/pom.xml b/main/pom.xml index e86c4a9f..992953f7 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -21,18 +21,19 @@ --> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.onap.policy.xacml-pdp</groupId> <artifactId>policy-xacml-pdp</artifactId> - <version>3.0.0-SNAPSHOT</version> + <version>3.0.1-SNAPSHOT</version> </parent> <artifactId>xacml-main</artifactId> <name>${project.artifactId}</name> - <description>The main module of Policy PDP-X that handles startup, lifecycle management, and parameters.</description> + <description>The main module of Policy PDP-X that handles startup, lifecycle management, and parameters. + </description> <properties> <jacoco.dataFile>${project.basedir}/../target/code-coverage/jacoco-ut.exec</jacoco.dataFile> @@ -128,16 +129,10 @@ <artifactId>spring-test</artifactId> <scope>test</scope> </dependency> - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <scope>test</scope> - </dependency> <!-- Swagger v3 annotations --> <dependency> <groupId>io.swagger.core.v3</groupId> - <artifactId>swagger-annotations</artifactId> - <version>2.2.7</version> + <artifactId>swagger-annotations</artifactId> </dependency> </dependencies> @@ -178,7 +173,6 @@ <language>jaxrs-spec</language> <generateModels>false</generateModels> <generateSupportingFiles>false</generateSupportingFiles> - <sortParamsByRequiredFlag>false</sortParamsByRequiredFlag> <importMappings> HealthCheckReport=org.onap.policy.common.endpoints.report.HealthCheckReport, DecisionException=org.onap.policy.models.decisions.concepts.DecisionException, @@ -190,13 +184,14 @@ HealthCheckProvider=org.onap.policy.pdpx.main.rest.provider.HealthCheckProvider, StatisticsProvider=org.onap.policy.pdpx.main.rest.provider.StatisticsProvider, Request=com.att.research.xacml.api.Request, - Response=javax.ws.rs.core.Response + Response=jakarta.ws.rs.core.Response </importMappings> <configOptions> <sourceFolder>src/gen/java</sourceFolder> - <dateLibrary>java11</dateLibrary> + <dateLibrary>java17</dateLibrary> <interfaceOnly>true</interfaceOnly> <useTags>true</useTags> + <jakarta>true</jakarta> </configOptions> </configuration> </execution> diff --git a/main/src/main/java/org/onap/policy/pdpx/main/XacmlState.java b/main/src/main/java/org/onap/policy/pdpx/main/XacmlState.java index 7f40532d..d67a1fad 100644 --- a/main/src/main/java/org/onap/policy/pdpx/main/XacmlState.java +++ b/main/src/main/java/org/onap/policy/pdpx/main/XacmlState.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019, 2021-2022 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/main/src/main/java/org/onap/policy/pdpx/main/rest/XacmlPdpRestController.java b/main/src/main/java/org/onap/policy/pdpx/main/rest/XacmlPdpRestController.java index 05f40cc5..3adf0b1f 100644 --- a/main/src/main/java/org/onap/policy/pdpx/main/rest/XacmlPdpRestController.java +++ b/main/src/main/java/org/onap/policy/pdpx/main/rest/XacmlPdpRestController.java @@ -22,18 +22,18 @@ package org.onap.policy.pdpx.main.rest; import com.att.research.xacml.api.Request; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.HeaderParam; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.Response.ResponseBuilder; import java.util.UUID; -import javax.servlet.http.HttpServletRequest; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.ResponseBuilder; import org.onap.policy.models.decisions.concepts.DecisionException; import org.onap.policy.models.decisions.concepts.DecisionRequest; import org.onap.policy.pdpx.main.rest.provider.DecisionProvider; diff --git a/main/src/main/java/org/onap/policy/pdpx/main/rest/XacmlPdpServiceFilter.java b/main/src/main/java/org/onap/policy/pdpx/main/rest/XacmlPdpServiceFilter.java index 8e34414d..3a16d54d 100644 --- a/main/src/main/java/org/onap/policy/pdpx/main/rest/XacmlPdpServiceFilter.java +++ b/main/src/main/java/org/onap/policy/pdpx/main/rest/XacmlPdpServiceFilter.java @@ -3,6 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,16 +21,16 @@ package org.onap.policy.pdpx.main.rest; +import jakarta.servlet.Filter; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.ServletRequest; +import jakarta.servlet.ServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; /** * Filter that verifies that the API services (i.e., decision services) are enabled diff --git a/main/src/main/java/org/onap/policy/pdpx/main/rest/provider/DecisionProvider.java b/main/src/main/java/org/onap/policy/pdpx/main/rest/provider/DecisionProvider.java index 98340b2d..7bc23b15 100644 --- a/main/src/main/java/org/onap/policy/pdpx/main/rest/provider/DecisionProvider.java +++ b/main/src/main/java/org/onap/policy/pdpx/main/rest/provider/DecisionProvider.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019-2020, 2022 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -98,7 +99,7 @@ public class DecisionProvider { if (application != null) { return application; } - throw new DecisionException(javax.ws.rs.core.Response.Status.BAD_REQUEST, + throw new DecisionException(jakarta.ws.rs.core.Response.Status.BAD_REQUEST, "No application for action " + request.getAction()); } @@ -107,7 +108,7 @@ public class DecisionProvider { if (application instanceof NativePdpApplication) { return application; } - throw new DecisionException(javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR, + throw new DecisionException(jakarta.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR, "Native PDP application cannot be found"); } @@ -126,10 +127,7 @@ public class DecisionProvider { XacmlPdpStatisticsManager.getCurrent().updateDenyDecisionsCount(appName); break; - case INDETERMINATE: - case INDETERMINATE_DENY: - case INDETERMINATE_DENYPERMIT: - case INDETERMINATE_PERMIT: + case INDETERMINATE, INDETERMINATE_DENY, INDETERMINATE_DENYPERMIT, INDETERMINATE_PERMIT: XacmlPdpStatisticsManager.getCurrent().updateIndeterminantDecisionsCount(appName); break; diff --git a/main/src/main/java/org/onap/policy/pdpx/main/rest/serialization/XacmlExceptionMapper.java b/main/src/main/java/org/onap/policy/pdpx/main/rest/serialization/XacmlExceptionMapper.java index a2a78a89..91a63922 100644 --- a/main/src/main/java/org/onap/policy/pdpx/main/rest/serialization/XacmlExceptionMapper.java +++ b/main/src/main/java/org/onap/policy/pdpx/main/rest/serialization/XacmlExceptionMapper.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,9 +21,9 @@ package org.onap.policy.pdpx.main.rest.serialization; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; import java.io.IOException; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; import lombok.Getter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/main/src/main/java/org/onap/policy/pdpx/main/rest/serialization/XacmlJsonExceptionMapper.java b/main/src/main/java/org/onap/policy/pdpx/main/rest/serialization/XacmlJsonExceptionMapper.java index 03f3ddce..431169b8 100644 --- a/main/src/main/java/org/onap/policy/pdpx/main/rest/serialization/XacmlJsonExceptionMapper.java +++ b/main/src/main/java/org/onap/policy/pdpx/main/rest/serialization/XacmlJsonExceptionMapper.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,8 +21,8 @@ package org.onap.policy.pdpx.main.rest.serialization; -import javax.ws.rs.Produces; -import javax.ws.rs.ext.Provider; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.ext.Provider; /** * Catches IOException when decoding/encoding a REST xacml request/response and converts them from an HTTP 500 diff --git a/main/src/main/java/org/onap/policy/pdpx/main/rest/serialization/XacmlJsonMessageBodyHandler.java b/main/src/main/java/org/onap/policy/pdpx/main/rest/serialization/XacmlJsonMessageBodyHandler.java index 58ed5f76..3ebe89d1 100644 --- a/main/src/main/java/org/onap/policy/pdpx/main/rest/serialization/XacmlJsonMessageBodyHandler.java +++ b/main/src/main/java/org/onap/policy/pdpx/main/rest/serialization/XacmlJsonMessageBodyHandler.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2020-2022 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,6 +25,13 @@ import com.att.research.xacml.api.Request; import com.att.research.xacml.api.Response; import com.att.research.xacml.std.json.JsonRequestTranslator; import com.att.research.xacml.std.json.JsonResponseTranslator; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.ext.MessageBodyReader; +import jakarta.ws.rs.ext.MessageBodyWriter; +import jakarta.ws.rs.ext.Provider; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -31,13 +39,6 @@ import java.io.OutputStreamWriter; import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.nio.charset.StandardCharsets; -import javax.ws.rs.Consumes; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.ext.MessageBodyReader; -import javax.ws.rs.ext.MessageBodyWriter; -import javax.ws.rs.ext.Provider; /** * Provider that serializes and de-serializes xacml request/response json. diff --git a/main/src/main/java/org/onap/policy/pdpx/main/rest/serialization/XacmlXmlExceptionMapper.java b/main/src/main/java/org/onap/policy/pdpx/main/rest/serialization/XacmlXmlExceptionMapper.java index 562c0e91..aaedc912 100644 --- a/main/src/main/java/org/onap/policy/pdpx/main/rest/serialization/XacmlXmlExceptionMapper.java +++ b/main/src/main/java/org/onap/policy/pdpx/main/rest/serialization/XacmlXmlExceptionMapper.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,8 +21,8 @@ package org.onap.policy.pdpx.main.rest.serialization; -import javax.ws.rs.Produces; -import javax.ws.rs.ext.Provider; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.ext.Provider; /** * Catches IOException when decoding/encoding a REST xacml request/response and converts them from an HTTP 500 diff --git a/main/src/main/java/org/onap/policy/pdpx/main/rest/serialization/XacmlXmlMessageBodyHandler.java b/main/src/main/java/org/onap/policy/pdpx/main/rest/serialization/XacmlXmlMessageBodyHandler.java index 5ec17634..61160faa 100644 --- a/main/src/main/java/org/onap/policy/pdpx/main/rest/serialization/XacmlXmlMessageBodyHandler.java +++ b/main/src/main/java/org/onap/policy/pdpx/main/rest/serialization/XacmlXmlMessageBodyHandler.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2020-2022 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,6 +26,13 @@ import com.att.research.xacml.api.Response; import com.att.research.xacml.std.dom.DOMRequest; import com.att.research.xacml.std.dom.DOMResponse; import com.att.research.xacml.std.dom.DOMStructureException; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.ext.MessageBodyReader; +import jakarta.ws.rs.ext.MessageBodyWriter; +import jakarta.ws.rs.ext.Provider; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; @@ -32,13 +40,6 @@ import java.io.OutputStreamWriter; import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.nio.charset.StandardCharsets; -import javax.ws.rs.Consumes; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.ext.MessageBodyReader; -import javax.ws.rs.ext.MessageBodyWriter; -import javax.ws.rs.ext.Provider; /** * Provider that serializes and de-serializes xacml request/response xml. diff --git a/main/src/main/java/org/onap/policy/pdpx/main/startstop/XacmlPdpRestServer.java b/main/src/main/java/org/onap/policy/pdpx/main/startstop/XacmlPdpRestServer.java index 683d013e..33cf8934 100644 --- a/main/src/main/java/org/onap/policy/pdpx/main/startstop/XacmlPdpRestServer.java +++ b/main/src/main/java/org/onap/policy/pdpx/main/startstop/XacmlPdpRestServer.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,9 +21,9 @@ package org.onap.policy.pdpx.main.startstop; +import jakarta.servlet.Filter; import java.util.List; import java.util.Properties; -import javax.servlet.Filter; import org.onap.policy.common.endpoints.http.server.JsonExceptionMapper; import org.onap.policy.common.endpoints.http.server.RestServer; import org.onap.policy.common.endpoints.http.server.YamlExceptionMapper; diff --git a/main/src/main/resources/META-INF/persistence.xml b/main/src/main/resources/META-INF/persistence.xml index 5e589d69..c2d7d078 100644 --- a/main/src/main/resources/META-INF/persistence.xml +++ b/main/src/main/resources/META-INF/persistence.xml @@ -28,7 +28,7 @@ <class>org.onap.policy.guard.OperationsHistory</class> <properties> - <property name="javax.persistence.schema-generation.database.action" value="create" /> + <property name="jakarta.persistence.schema-generation.database.action" value="create" /> <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/> <property name="hibernate.show_sql" value="false" /> </properties> diff --git a/main/src/test/java/org/onap/policy/pdpx/main/CommonRest.java b/main/src/test/java/org/onap/policy/pdpx/main/CommonRest.java index 7bdd4c47..89312cf5 100644 --- a/main/src/test/java/org/onap/policy/pdpx/main/CommonRest.java +++ b/main/src/test/java/org/onap/policy/pdpx/main/CommonRest.java @@ -23,6 +23,11 @@ package org.onap.policy.pdpx.main; +import jakarta.ws.rs.client.Client; +import jakarta.ws.rs.client.ClientBuilder; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.client.WebTarget; +import jakarta.ws.rs.core.MediaType; import java.io.File; import java.io.IOException; import java.nio.charset.StandardCharsets; @@ -31,11 +36,6 @@ import java.nio.file.Path; import java.security.SecureRandom; import java.util.concurrent.atomic.AtomicBoolean; import javax.net.ssl.SSLContext; -import javax.ws.rs.client.Client; -import javax.ws.rs.client.ClientBuilder; -import javax.ws.rs.client.Invocation; -import javax.ws.rs.client.WebTarget; -import javax.ws.rs.core.MediaType; import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature; import org.junit.After; import org.junit.AfterClass; diff --git a/main/src/test/java/org/onap/policy/pdpx/main/XacmlStateTest.java b/main/src/test/java/org/onap/policy/pdpx/main/XacmlStateTest.java index a16f3a8f..8c412386 100644 --- a/main/src/test/java/org/onap/policy/pdpx/main/XacmlStateTest.java +++ b/main/src/test/java/org/onap/policy/pdpx/main/XacmlStateTest.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019, 2021-2022 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2021 Nordix Foundation. + * Modifications Copyright (C) 2021,2023 Nordix Foundation. * Modifications Copyright (C) 2023 Bell Canada. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/main/src/test/java/org/onap/policy/pdpx/main/rest/TestAbbreviateDecisionResults.java b/main/src/test/java/org/onap/policy/pdpx/main/rest/TestAbbreviateDecisionResults.java index 3e525e91..5dddec30 100644 --- a/main/src/test/java/org/onap/policy/pdpx/main/rest/TestAbbreviateDecisionResults.java +++ b/main/src/test/java/org/onap/policy/pdpx/main/rest/TestAbbreviateDecisionResults.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2020 Nordix Foundation + * Modifications Copyright (C) 2020,2023 Nordix Foundation * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,6 +26,9 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; +import jakarta.ws.rs.client.Entity; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import java.io.File; import java.io.IOException; import java.nio.file.Files; @@ -39,9 +42,6 @@ import java.util.HashMap; import java.util.Map; import java.util.Properties; import java.util.ServiceLoader; -import javax.ws.rs.client.Entity; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.ClassRule; diff --git a/main/src/test/java/org/onap/policy/pdpx/main/rest/TestDecision.java b/main/src/test/java/org/onap/policy/pdpx/main/rest/TestDecision.java index b369ad31..93d04ce0 100644 --- a/main/src/test/java/org/onap/policy/pdpx/main/rest/TestDecision.java +++ b/main/src/test/java/org/onap/policy/pdpx/main/rest/TestDecision.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019-2022 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019,2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,6 +26,10 @@ import static org.junit.Assert.assertEquals; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import jakarta.ws.rs.client.Entity; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.Response.Status; import java.io.File; import java.io.IOException; import java.nio.file.Files; @@ -37,10 +41,6 @@ import java.security.NoSuchAlgorithmException; import java.util.Collections; import java.util.HashMap; import java.util.Map; -import javax.ws.rs.client.Entity; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.ClassRule; diff --git a/main/src/test/java/org/onap/policy/pdpx/main/rest/TestXacmlPdpRestServer.java b/main/src/test/java/org/onap/policy/pdpx/main/rest/TestXacmlPdpRestServer.java index b626142a..2cac6dcc 100644 --- a/main/src/test/java/org/onap/policy/pdpx/main/rest/TestXacmlPdpRestServer.java +++ b/main/src/test/java/org/onap/policy/pdpx/main/rest/TestXacmlPdpRestServer.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019, 2021-2022 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,9 +23,9 @@ package org.onap.policy.pdpx.main.rest; import static org.junit.Assert.assertEquals; +import jakarta.ws.rs.client.Invocation; import java.util.HashMap; import java.util.Map; -import javax.ws.rs.client.Invocation; import org.junit.Test; import org.onap.policy.common.endpoints.report.HealthCheckReport; import org.onap.policy.pdpx.main.CommonRest; diff --git a/main/src/test/java/org/onap/policy/pdpx/main/rest/TestXacmlPdpServiceFilter.java b/main/src/test/java/org/onap/policy/pdpx/main/rest/TestXacmlPdpServiceFilter.java index 9f098f78..f72ae4f4 100644 --- a/main/src/test/java/org/onap/policy/pdpx/main/rest/TestXacmlPdpServiceFilter.java +++ b/main/src/test/java/org/onap/policy/pdpx/main/rest/TestXacmlPdpServiceFilter.java @@ -3,6 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,9 +26,9 @@ import static org.mockito.Mockito.lenient; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import javax.servlet.FilterChain; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.FilterChain; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; diff --git a/main/src/test/java/org/onap/policy/pdpx/main/rest/serialization/CommonSerialization.java b/main/src/test/java/org/onap/policy/pdpx/main/rest/serialization/CommonSerialization.java index 2b4a4fd0..2a0a5524 100644 --- a/main/src/test/java/org/onap/policy/pdpx/main/rest/serialization/CommonSerialization.java +++ b/main/src/test/java/org/onap/policy/pdpx/main/rest/serialization/CommonSerialization.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,9 +26,9 @@ import static org.junit.Assert.assertTrue; import com.att.research.xacml.api.Request; import com.att.research.xacml.api.Response; +import jakarta.ws.rs.core.MediaType; import java.lang.annotation.Annotation; import java.lang.reflect.Type; -import javax.ws.rs.core.MediaType; public class CommonSerialization { diff --git a/main/src/test/java/org/onap/policy/pdpx/main/rest/serialization/TestXacmlJsonExceptionMapper.java b/main/src/test/java/org/onap/policy/pdpx/main/rest/serialization/TestXacmlJsonExceptionMapper.java index 1b3cc209..31d6c60f 100644 --- a/main/src/test/java/org/onap/policy/pdpx/main/rest/serialization/TestXacmlJsonExceptionMapper.java +++ b/main/src/test/java/org/onap/policy/pdpx/main/rest/serialization/TestXacmlJsonExceptionMapper.java @@ -3,6 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,8 +23,8 @@ package org.onap.policy.pdpx.main.rest.serialization; import static org.junit.Assert.assertEquals; +import jakarta.ws.rs.core.Response; import java.io.IOException; -import javax.ws.rs.core.Response; import org.junit.Before; import org.junit.Test; import org.onap.policy.common.utils.coder.CoderException; diff --git a/main/src/test/java/org/onap/policy/pdpx/main/rest/serialization/TestXacmlXmlExceptionMapper.java b/main/src/test/java/org/onap/policy/pdpx/main/rest/serialization/TestXacmlXmlExceptionMapper.java index c9b7bac5..3fd76c3b 100644 --- a/main/src/test/java/org/onap/policy/pdpx/main/rest/serialization/TestXacmlXmlExceptionMapper.java +++ b/main/src/test/java/org/onap/policy/pdpx/main/rest/serialization/TestXacmlXmlExceptionMapper.java @@ -3,6 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,8 +23,8 @@ package org.onap.policy.pdpx.main.rest.serialization; import static org.junit.Assert.assertEquals; +import jakarta.ws.rs.core.Response; import java.io.IOException; -import javax.ws.rs.core.Response; import org.junit.Before; import org.junit.Test; import org.onap.policy.common.utils.coder.CoderException; diff --git a/main/src/test/resources/META-INF/persistence.xml b/main/src/test/resources/META-INF/persistence.xml index f97945c2..d7f9d921 100644 --- a/main/src/test/resources/META-INF/persistence.xml +++ b/main/src/test/resources/META-INF/persistence.xml @@ -28,8 +28,8 @@ <class>org.onap.policy.guard.OperationsHistory</class> <properties> - <property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/> - <property name="javax.persistence.schema-generation.create-source" value="metadata"/> + <property name="jakarta.persistence.schema-generation.database.action" value="drop-and-create"/> + <property name="jakarta.persistence.schema-generation.create-source" value="metadata"/> <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/> <property name="hibernate.show_sql" value="false" /> </properties> diff --git a/main/src/test/resources/apps/guard/xacml.properties b/main/src/test/resources/apps/guard/xacml.properties index 0f450fef..baed91ae 100644 --- a/main/src/test/resources/apps/guard/xacml.properties +++ b/main/src/test/resources/apps/guard/xacml.properties @@ -48,7 +48,7 @@ xacml.pip.engines=count-recent-operations,get-operation-outcome # JPA Properties # eclipselink.target-database=Auto -javax.persistence.jdbc.driver=org.h2.Driver -javax.persistence.jdbc.url=jdbc:h2:mem:testdb;DATABASE_TO_UPPER=FALSE -javax.persistence.jdbc.user=policy -javax.persistence.jdbc.password=P01icY +jakarta.persistence.jdbc.driver=org.h2.Driver +jakarta.persistence.jdbc.url=jdbc:h2:mem:testdb;DATABASE_TO_UPPER=FALSE +jakarta.persistence.jdbc.user=policy +jakarta.persistence.jdbc.password=P01icY |