diff options
author | adheli.tavares <adheli.tavares@est.tech> | 2023-08-07 16:01:21 -0400 |
---|---|---|
committer | adheli.tavares <adheli.tavares@est.tech> | 2023-09-22 16:08:11 +0100 |
commit | 396f60280265a37379916ad12752a94691118f65 (patch) | |
tree | 4b6d54a1567482a89bc471577c6efe484f6dadd8 | |
parent | d6f6ebc925506cdf18b903df2cd3cbcef311082d (diff) |
Upgrade java-17 in drools-pdp
Issue-ID: POLICY-4676
Change-Id: I85a0f6303b30cd0405d63be003c9288f59a9d6b7
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
40 files changed, 217 insertions, 441 deletions
diff --git a/feature-distributed-locking/pom.xml b/feature-distributed-locking/pom.xml index b7cde660..2482d1e1 100644 --- a/feature-distributed-locking/pom.xml +++ b/feature-distributed-locking/pom.xml @@ -19,14 +19,15 @@ ============LICENSE_END========================================================= --> -<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"> +<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"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.1-SNAPSHOT</version> </parent> <artifactId>feature-distributed-locking</artifactId> @@ -107,21 +108,6 @@ <version>2.11.1</version> </dependency> <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <scope>test</scope> - </dependency> - <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <scope>test</scope> @@ -131,18 +117,6 @@ <artifactId>h2</artifactId> <scope>test</scope> </dependency> - <dependency> - <groupId>org.onap.policy.common</groupId> - <artifactId>utils</artifactId> - <version>${policy.common.version}</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.onap.policy.common</groupId> - <artifactId>utils-test</artifactId> - <version>${policy.common.version}</version> - <scope>test</scope> - </dependency> </dependencies> </project> diff --git a/feature-distributed-locking/src/main/feature/config/feature-distributed-locking.properties b/feature-distributed-locking/src/main/feature/config/feature-distributed-locking.properties index 3034e235..69629e15 100644 --- a/feature-distributed-locking/src/main/feature/config/feature-distributed-locking.properties +++ b/feature-distributed-locking/src/main/feature/config/feature-distributed-locking.properties @@ -20,10 +20,10 @@ ### #Database properties -javax.persistence.jdbc.driver=org.mariadb.jdbc.Driver -javax.persistence.jdbc.url=${envd:JDBC_URL}pooling${envd:JDBC_OPTS} -javax.persistence.jdbc.user=${envd:SQL_USER} -javax.persistence.jdbc.password=${envd:SQL_PASSWORD} +jakarta.persistence.jdbc.driver=org.mariadb.jdbc.Driver +jakarta.persistence.jdbc.url=${envd:JDBC_URL}pooling${envd:JDBC_OPTS} +jakarta.persistence.jdbc.user=${envd:SQL_USER} +jakarta.persistence.jdbc.password=${envd:SQL_PASSWORD} # default property values are commented out #distributed.locking.expire.check.seconds=900 diff --git a/feature-distributed-locking/src/main/java/org/onap/policy/distributed/locking/DistributedLockProperties.java b/feature-distributed-locking/src/main/java/org/onap/policy/distributed/locking/DistributedLockProperties.java index 4153ee89..df4ca91d 100644 --- a/feature-distributed-locking/src/main/java/org/onap/policy/distributed/locking/DistributedLockProperties.java +++ b/feature-distributed-locking/src/main/java/org/onap/policy/distributed/locking/DistributedLockProperties.java @@ -35,10 +35,10 @@ public class DistributedLockProperties { public static final String PREFIX = "distributed.locking."; // @formatter:off - public static final String DB_DRIVER = "javax.persistence.jdbc.driver"; - public static final String DB_URL = "javax.persistence.jdbc.url"; - public static final String DB_USER = "javax.persistence.jdbc.user"; - public static final String DB_PASS = "javax.persistence.jdbc.password"; + public static final String DB_DRIVER = "jakarta.persistence.jdbc.driver"; + public static final String DB_URL = "jakarta.persistence.jdbc.url"; + public static final String DB_USER = "jakarta.persistence.jdbc.user"; + public static final String DB_PASS = "jakarta.persistence.jdbc.password"; public static final String EXPIRE_CHECK_SEC = PREFIX + "expire.check.seconds"; public static final String RETRY_SEC = PREFIX + "retry.seconds"; public static final String MAX_RETRIES = PREFIX + "max.retries"; diff --git a/feature-distributed-locking/src/test/resources/feature-distributed-locking.properties b/feature-distributed-locking/src/test/resources/feature-distributed-locking.properties index 75a365fc..9097a417 100644 --- a/feature-distributed-locking/src/test/resources/feature-distributed-locking.properties +++ b/feature-distributed-locking/src/test/resources/feature-distributed-locking.properties @@ -19,10 +19,10 @@ # ============LICENSE_END========================================================= ### -javax.persistence.jdbc.driver=org.h2.Driver -javax.persistence.jdbc.url=jdbc:h2:mem:pooling -javax.persistence.jdbc.user=user -javax.persistence.jdbc.password=password +jakarta.persistence.jdbc.driver=org.h2.Driver +jakarta.persistence.jdbc.url=jdbc:h2:mem:pooling +jakarta.persistence.jdbc.user=user +jakarta.persistence.jdbc.password=password distributed.locking.expire.check.seconds=900 distributed.locking.retry.seconds=60 diff --git a/feature-healthcheck/pom.xml b/feature-healthcheck/pom.xml index 6b24443b..57093298 100644 --- a/feature-healthcheck/pom.xml +++ b/feature-healthcheck/pom.xml @@ -19,14 +19,15 @@ ============LICENSE_END========================================================= --> -<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"> +<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"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.1-SNAPSHOT</version> </parent> <artifactId>feature-healthcheck</artifactId> @@ -98,19 +99,19 @@ <language>jaxrs-spec</language> <generateModels>false</generateModels> <generateSupportingFiles>false</generateSupportingFiles> - <sortParamsByRequiredFlag>false</sortParamsByRequiredFlag> <importMappings> - Response=javax.ws.rs.core.Response + Response=jakarta.ws.rs.core.Response </importMappings> <typeMappings> <typeMapping>boolean=boolean</typeMapping> </typeMappings> <configOptions> <sourceFolder>src/gen/java</sourceFolder> - <dateLibrary>java11</dateLibrary> + <dateLibrary>java17</dateLibrary> <interfaceOnly>true</interfaceOnly> <useTags>true</useTags> <skipIfSpecIsUnchanged>false</skipIfSpecIsUnchanged> + <jakarta>true</jakarta> </configOptions> </configuration> </execution> @@ -127,38 +128,11 @@ <scope>provided</scope> </dependency> <dependency> - <groupId>org.onap.policy.common</groupId> - <artifactId>policy-endpoints</artifactId> - <version>${policy.common.version}</version> - <scope>provided</scope> - </dependency> - <dependency> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>policy-management</artifactId> <version>${project.version}</version> <scope>provided</scope> </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.awaitility</groupId> - <artifactId>awaitility</artifactId> - <scope>test</scope> - </dependency> - <!-- Swagger v3 annotations --> - <dependency> - <groupId>io.swagger.core.v3</groupId> - <artifactId>swagger-annotations</artifactId> - <version>${version.swagger.core.v3}</version> - </dependency> </dependencies> </project> diff --git a/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/HealthCheckManager.java b/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/HealthCheckManager.java index daedcc20..0e81c206 100644 --- a/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/HealthCheckManager.java +++ b/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/HealthCheckManager.java @@ -21,6 +21,7 @@ package org.onap.policy.drools.healthcheck; import com.google.common.base.Strings; +import jakarta.ws.rs.core.Response; import java.lang.management.ManagementFactory; import java.util.ArrayList; import java.util.Arrays; @@ -33,7 +34,6 @@ import java.util.function.Function; import java.util.function.Supplier; import java.util.regex.Pattern; import java.util.stream.Collectors; -import javax.ws.rs.core.Response; import lombok.AccessLevel; import lombok.Getter; import lombok.NonNull; diff --git a/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/RestHealthCheck.java b/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/RestHealthCheck.java index 64cea621..a2fb4ced 100644 --- a/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/RestHealthCheck.java +++ b/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/RestHealthCheck.java @@ -21,12 +21,12 @@ package org.onap.policy.drools.healthcheck; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import org.onap.policy.common.endpoints.http.client.HttpClientFactory; import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance; import org.onap.policy.common.endpoints.http.server.YamlMessageBodyHandler; diff --git a/feature-healthcheck/src/test/java/org/onap/policy/drools/healthcheck/HealthCheckManagerTest.java b/feature-healthcheck/src/test/java/org/onap/policy/drools/healthcheck/HealthCheckManagerTest.java index 20cfa9e0..9e081015 100644 --- a/feature-healthcheck/src/test/java/org/onap/policy/drools/healthcheck/HealthCheckManagerTest.java +++ b/feature-healthcheck/src/test/java/org/onap/policy/drools/healthcheck/HealthCheckManagerTest.java @@ -32,6 +32,7 @@ import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; +import jakarta.ws.rs.core.Response; import java.net.HttpURLConnection; import java.util.ArrayList; import java.util.Arrays; @@ -39,7 +40,6 @@ import java.util.List; import java.util.Map; import java.util.Properties; import java.util.stream.Collectors; -import javax.ws.rs.core.Response; import org.eclipse.jetty.http.HttpStatus; import org.junit.Before; import org.junit.Test; diff --git a/feature-healthcheck/src/test/java/org/onap/policy/drools/healthcheck/RestHealthCheckTest.java b/feature-healthcheck/src/test/java/org/onap/policy/drools/healthcheck/RestHealthCheckTest.java index 2af39a80..13ad5211 100644 --- a/feature-healthcheck/src/test/java/org/onap/policy/drools/healthcheck/RestHealthCheckTest.java +++ b/feature-healthcheck/src/test/java/org/onap/policy/drools/healthcheck/RestHealthCheckTest.java @@ -25,7 +25,7 @@ import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -import javax.ws.rs.core.Response; +import jakarta.ws.rs.core.Response; import org.junit.BeforeClass; import org.junit.Test; import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams; diff --git a/feature-healthcheck/src/test/java/org/onap/policy/drools/healthcheck/RestMockHealthCheck.java b/feature-healthcheck/src/test/java/org/onap/policy/drools/healthcheck/RestMockHealthCheck.java index 910974ef..d2376d9d 100644 --- a/feature-healthcheck/src/test/java/org/onap/policy/drools/healthcheck/RestMockHealthCheck.java +++ b/feature-healthcheck/src/test/java/org/onap/policy/drools/healthcheck/RestMockHealthCheck.java @@ -22,13 +22,13 @@ package org.onap.policy.drools.healthcheck; import static org.awaitility.Awaitility.await; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.Response.Status; import java.util.concurrent.TimeUnit; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; import org.onap.policy.common.endpoints.http.server.YamlMessageBodyHandler; @Path("/") diff --git a/feature-healthcheck/src/test/java/org/onap/policy/drools/healthcheck/TestAafHealthCheckFilter.java b/feature-healthcheck/src/test/java/org/onap/policy/drools/healthcheck/TestAafHealthCheckFilter.java index 9c34670c..3abcd32e 100644 --- a/feature-healthcheck/src/test/java/org/onap/policy/drools/healthcheck/TestAafHealthCheckFilter.java +++ b/feature-healthcheck/src/test/java/org/onap/policy/drools/healthcheck/TestAafHealthCheckFilter.java @@ -20,7 +20,7 @@ package org.onap.policy.drools.healthcheck; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.onap.policy.common.utils.network.NetworkUtil; /** diff --git a/feature-legacy-config/pom.xml b/feature-legacy-config/pom.xml index 3f0192ea..06dd37b3 100644 --- a/feature-legacy-config/pom.xml +++ b/feature-legacy-config/pom.xml @@ -20,13 +20,13 @@ --> <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.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.1-SNAPSHOT</version> </parent> <artifactId>feature-legacy-config</artifactId> @@ -84,45 +84,17 @@ </build> <dependencies> - - <dependency> - <groupId>org.onap.policy.common</groupId> - <artifactId>policy-endpoints</artifactId> - <version>${policy.common.version}</version> - <scope>provided</scope> - </dependency> - <dependency> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>policy-management</artifactId> <version>${project.version}</version> <scope>provided</scope> </dependency> - <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <scope>provided</scope> </dependency> - - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <scope>test</scope> - </dependency> - </dependencies> </project> diff --git a/feature-legacy-config/src/main/java/org/onap/policy/drools/server/restful/RestLegacyConfigManager.java b/feature-legacy-config/src/main/java/org/onap/policy/drools/server/restful/RestLegacyConfigManager.java index 53b359c4..7486003c 100644 --- a/feature-legacy-config/src/main/java/org/onap/policy/drools/server/restful/RestLegacyConfigManager.java +++ b/feature-legacy-config/src/main/java/org/onap/policy/drools/server/restful/RestLegacyConfigManager.java @@ -20,12 +20,12 @@ package org.onap.policy.drools.server.restful; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import org.onap.policy.common.endpoints.http.server.YamlMessageBodyHandler; import org.onap.policy.drools.legacy.config.LegacyConfigFeature; diff --git a/feature-legacy-config/src/test/java/org/onap/policy/drools/server/restful/RestLegacyConfigTest.java b/feature-legacy-config/src/test/java/org/onap/policy/drools/server/restful/RestLegacyConfigTest.java index 6dd2edbc..46bdb0f8 100644 --- a/feature-legacy-config/src/test/java/org/onap/policy/drools/server/restful/RestLegacyConfigTest.java +++ b/feature-legacy-config/src/test/java/org/onap/policy/drools/server/restful/RestLegacyConfigTest.java @@ -21,8 +21,8 @@ package org.onap.policy.drools.server.restful; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; +import jakarta.ws.rs.core.Response; import java.util.Properties; -import javax.ws.rs.core.Response; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; diff --git a/feature-lifecycle/pom.xml b/feature-lifecycle/pom.xml index fb5cecbd..dd5faacf 100644 --- a/feature-lifecycle/pom.xml +++ b/feature-lifecycle/pom.xml @@ -20,13 +20,13 @@ --> <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.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.1-SNAPSHOT</version> </parent> <artifactId>feature-lifecycle</artifactId> @@ -91,65 +91,22 @@ <version>${project.version}</version> <scope>provided</scope> </dependency> - <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <scope>provided</scope> </dependency> - - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.onap.policy.common</groupId> - <artifactId>policy-endpoints</artifactId> - <version>${policy.common.version}</version> - <scope>provided</scope> - </dependency> - - <dependency> - <groupId>org.onap.policy.common</groupId> - <artifactId>utils-test</artifactId> - <version>${policy.common.version}</version> - <scope>test</scope> - </dependency> - <dependency> <groupId>org.onap.policy.common</groupId> <artifactId>gson</artifactId> <version>${policy.common.version}</version> </dependency> - - <dependency> - <groupId>org.onap.policy.common</groupId> - <artifactId>utils</artifactId> - <version>${policy.common.version}</version> - <scope>provided</scope> - </dependency> - <dependency> <groupId>org.onap.policy.models</groupId> <artifactId>policy-models-examples</artifactId> <version>${policy.models.version}</version> <scope>test</scope> </dependency> - <dependency> <groupId>commons-beanutils</groupId> <artifactId>commons-beanutils</artifactId> diff --git a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFeature.java b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFeature.java index 27d845b5..953f0b37 100644 --- a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFeature.java +++ b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFeature.java @@ -37,7 +37,7 @@ public class LifecycleFeature * Lifecycle FSM. */ @Getter - public static final LifecycleFsm fsm = new LifecycleFsm(); + public static LifecycleFsm fsm = new LifecycleFsm(); @Override public int getSequenceNumber() { diff --git a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java index c946f3b2..c67367e0 100644 --- a/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java +++ b/feature-lifecycle/src/main/java/org/onap/policy/drools/lifecycle/LifecycleFsm.java @@ -623,7 +623,6 @@ public class LifecycleFsm implements Startable { return status; } - private boolean source() { List<TopicSource> sources = TopicEndpointManager.getManager().addTopicSources(properties); if (sources.isEmpty()) { diff --git a/feature-lifecycle/src/main/java/org/onap/policy/drools/server/restful/RestLifecycleManager.java b/feature-lifecycle/src/main/java/org/onap/policy/drools/server/restful/RestLifecycleManager.java index cad980f5..6740700a 100644 --- a/feature-lifecycle/src/main/java/org/onap/policy/drools/server/restful/RestLifecycleManager.java +++ b/feature-lifecycle/src/main/java/org/onap/policy/drools/server/restful/RestLifecycleManager.java @@ -20,18 +20,18 @@ package org.onap.policy.drools.server.restful; import com.worldturner.medeia.api.ValidationFailedException; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.DELETE; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.PUT; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import java.util.Collections; import java.util.List; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; import org.onap.policy.common.endpoints.http.server.YamlMessageBodyHandler; import org.onap.policy.common.utils.coder.CoderException; import org.onap.policy.common.utils.coder.StandardCoder; @@ -375,7 +375,6 @@ public class RestLifecycleManager implements LifecycleApi { return Response.status(Response.Status.OK).entity(Collections.emptyList()).build(); } - private Response deployUndeployOperation(String policy, boolean deploy) { var toscaPolicy = getToscaPolicy(policy); if (toscaPolicy == null) { diff --git a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/ControllerSupport.java b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/ControllerSupport.java index 4c1830b8..4e0b4bf7 100644 --- a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/ControllerSupport.java +++ b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/ControllerSupport.java @@ -135,14 +135,10 @@ public class ControllerSupport { * Change final marker in static field. */ public static <T> Field unsetFinalStaticAccess(Class<T> clazz, String fieldName) - throws NoSuchFieldException, IllegalAccessException { + throws NoSuchFieldException { Field field = clazz.getDeclaredField(fieldName); field.setAccessible(true); - Field modifiers = Field.class.getDeclaredField("modifiers"); - modifiers.setAccessible(true); - modifiers.setInt(field, field.getModifiers() & ~Modifier.FINAL); - return field; } diff --git a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleFsmTest.java b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleFsmTest.java index c08ac9fe..e5fc13a8 100644 --- a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleFsmTest.java +++ b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleFsmTest.java @@ -202,7 +202,6 @@ public class LifecycleFsmTest { assertEquals("foo", fsm.getPdpType()); } - @Test public void testMergePolicies() { assertEquals(List.of(), fsm.getActivePolicies()); diff --git a/feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java b/feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java index 85294306..29ef5a77 100644 --- a/feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java +++ b/feature-lifecycle/src/test/java/org/onap/policy/drools/server/restful/RestLifecycleManagerTest.java @@ -25,15 +25,15 @@ 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.Response; +import jakarta.ws.rs.core.Response.Status; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.util.Collections; import java.util.List; import java.util.Properties; -import javax.ws.rs.client.Entity; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; import org.apache.commons.lang3.StringUtils; import org.junit.After; import org.junit.Before; diff --git a/feature-no-locking/pom.xml b/feature-no-locking/pom.xml index fdce0f33..1c011772 100644 --- a/feature-no-locking/pom.xml +++ b/feature-no-locking/pom.xml @@ -27,7 +27,7 @@ <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.1-SNAPSHOT</version> </parent> <artifactId>feature-no-locking</artifactId> @@ -97,21 +97,6 @@ <version>${project.version}</version> <scope>provided</scope> </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <scope>test</scope> - </dependency> </dependencies> </project> diff --git a/feature-pooling-dmaap/pom.xml b/feature-pooling-dmaap/pom.xml index a38edb69..ce6d1af4 100644 --- a/feature-pooling-dmaap/pom.xml +++ b/feature-pooling-dmaap/pom.xml @@ -7,9 +7,9 @@ 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. @@ -18,14 +18,15 @@ ============LICENSE_END========================================================= --> -<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"> +<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"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.1-SNAPSHOT</version> </parent> <artifactId>feature-pooling-dmaap</artifactId> @@ -66,7 +67,6 @@ </goals> <phase>prepare-package</phase> <configuration> - <transitive>false</transitive> <outputDirectory>${project.build.directory}/assembly/lib</outputDirectory> <overWriteReleases>false</overWriteReleases> <overWriteSnapshots>true</overWriteSnapshots> @@ -84,7 +84,6 @@ </build> <dependencies> - <dependency> <groupId>com.att.nsa</groupId> <artifactId>cambriaClient</artifactId> @@ -100,51 +99,23 @@ </exclusions> <scope>provided</scope> </dependency> - <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <scope>provided</scope> </dependency> - <dependency> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>policy-core</artifactId> <version>${project.version}</version> <scope>provided</scope> </dependency> - <dependency> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>policy-management</artifactId> <version>${project.version}</version> <scope>provided</scope> </dependency> - - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.onap.policy.common</groupId> - <artifactId>utils-test</artifactId> - <version>${policy.common.version}</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <scope>test</scope> - </dependency> </dependencies> </project> diff --git a/feature-test-transaction/pom.xml b/feature-test-transaction/pom.xml index 220e157d..349052ed 100644 --- a/feature-test-transaction/pom.xml +++ b/feature-test-transaction/pom.xml @@ -19,12 +19,13 @@ ============LICENSE_END========================================================= --> -<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"> +<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"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.1-SNAPSHOT</version> </parent> <artifactId>feature-test-transaction</artifactId> @@ -67,7 +68,6 @@ </goals> <phase>prepare-package</phase> <configuration> - <transitive>false</transitive> <outputDirectory>${project.build.directory}/assembly/lib</outputDirectory> <overWriteReleases>false</overWriteReleases> <overWriteSnapshots>true</overWriteSnapshots> @@ -90,15 +90,5 @@ <version>${project.version}</version> <scope>provided</scope> </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <scope>test</scope> - </dependency> </dependencies> </project> diff --git a/packages/base/pom.xml b/packages/base/pom.xml index 1f9a0254..ec68223e 100644 --- a/packages/base/pom.xml +++ b/packages/base/pom.xml @@ -8,9 +8,9 @@ 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. @@ -19,14 +19,15 @@ ============LICENSE_END========================================================= --> -<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"> +<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"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-packages</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.1-SNAPSHOT</version> </parent> <artifactId>base</artifactId> diff --git a/packages/docker/pom.xml b/packages/docker/pom.xml index 7228de55..96ddcab3 100644 --- a/packages/docker/pom.xml +++ b/packages/docker/pom.xml @@ -20,14 +20,15 @@ ============LICENSE_END========================================================= --> -<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"> +<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"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-packages</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.1-SNAPSHOT</version> </parent> <artifactId>docker</artifactId> diff --git a/packages/docker/src/main/docker/Dockerfile b/packages/docker/src/main/docker/Dockerfile index 6b993830..ac13bf61 100644 --- a/packages/docker/src/main/docker/Dockerfile +++ b/packages/docker/src/main/docker/Dockerfile @@ -2,7 +2,7 @@ # Dockerfile # ============LICENSE_START======================================================= # Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved. -# Modifications Copyright (C) 2022 Nordix Foundation. +# Modifications Copyright (C) 2022-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. @@ -19,7 +19,7 @@ # SPDX-License-Identifier: Apache-2.0 # ============LICENSE_END========================================================= #------------------------------------------------------------------------------- -FROM onap/policy-jdk-alpine:3.0.0-SNAPSHOT +FROM onap/policy-jdk-alpine:3.0.1-SNAPSHOT LABEL maintainer="Policy Team" LABEL org.opencontainers.image.title="Policy Drools PDP" @@ -39,7 +39,7 @@ ARG MVN_RELEASE_REPO_URL ARG http_proxy ENV BUILD_VERSION_DROOLS $BUILD_VERSION_DROOLS -ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk +ENV JAVA_HOME /usr/lib/jvm/java-17-openjdk ENV POLICY_INSTALL $POLICY_INSTALL ENV POLICY_INSTALL_INIT $POLICY_INSTALL/config ENV POLICY_LOGS $POLICY_LOGS diff --git a/packages/docker/src/main/docker/suse.Dockerfile b/packages/docker/src/main/docker/suse.Dockerfile index a4331f20..e6bf9dbd 100644 --- a/packages/docker/src/main/docker/suse.Dockerfile +++ b/packages/docker/src/main/docker/suse.Dockerfile @@ -38,7 +38,7 @@ ARG MVN_RELEASE_REPO_URL ARG http_proxy ENV BUILD_VERSION_DROOLS $BUILD_VERSION_DROOLS -ENV JAVA_HOME /usr/lib64/jvm/java-11-openjdk +ENV JAVA_HOME /usr/lib64/jvm/java-17-openjdk ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8 ENV POLICY_INSTALL $POLICY_INSTALL ENV POLICY_INSTALL_INIT $POLICY_INSTALL/config @@ -54,7 +54,7 @@ ENV http_proxy $http_proxy RUN zypper -n -q install --no-recommends \ curl \ gzip \ - java-11-openjdk-devel \ + java-17-openjdk-devel \ maven \ mariadb-client \ netcat-openbsd \ diff --git a/packages/install/pom.xml b/packages/install/pom.xml index bfabe63b..97fbb7e8 100644 --- a/packages/install/pom.xml +++ b/packages/install/pom.xml @@ -20,15 +20,15 @@ --> <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"> + 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"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-packages</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.1-SNAPSHOT</version> </parent> <artifactId>install-drools</artifactId> diff --git a/packages/pom.xml b/packages/pom.xml index 696c84bb..3dbda7aa 100644 --- a/packages/pom.xml +++ b/packages/pom.xml @@ -21,12 +21,12 @@ --> <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.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.1-SNAPSHOT</version> </parent> <artifactId>drools-packages</artifactId> <packaging>pom</packaging> @@ -34,7 +34,7 @@ <description>ONAP Policy Drools PDP Installation Packages</description> <properties> - <!-- There is no code in this sub-module, only holds interfaces. So skip sonar. --> + <!-- There is no code in this submodule, only holds interfaces. So skip sonar. --> <sonar.skip>true</sonar.skip> </properties> diff --git a/policy-core/pom.xml b/policy-core/pom.xml index b2dd4e31..df5ea81c 100644 --- a/policy-core/pom.xml +++ b/policy-core/pom.xml @@ -21,14 +21,15 @@ ============LICENSE_END========================================================= --> -<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/maven-v4_0_0.xsd"> +<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/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <artifactId>policy-core</artifactId> <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.1-SNAPSHOT</version> </parent> <dependencies> @@ -46,7 +47,7 @@ <dependency> <groupId>org.apache.ant</groupId> <artifactId>ant</artifactId> - <version>1.10.12</version> + <version>1.10.13</version> </dependency> <dependency> @@ -88,16 +89,6 @@ <dependency> <groupId>org.drools</groupId> <artifactId>drools-persistence-jpa</artifactId> - <!-- - Exclude this because it's incompatible with eclipselink, which already - includes the same classes. - --> - <exclusions> - <exclusion> - <groupId>javax.persistence</groupId> - <artifactId>javax.persistence-api</artifactId> - </exclusion> - </exclusions> </dependency> <dependency> @@ -124,30 +115,34 @@ <scope>provided</scope> </dependency> + <!-- Provided dependencies --> <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> + <groupId>com.sun.xml.bind</groupId> + <artifactId>jaxb-xjc</artifactId> + <version>4.0.3</version> </dependency> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <scope>test</scope> + <groupId>com.sun.xml.bind</groupId> + <artifactId>jaxb-core</artifactId> + <version>4.0.3</version> </dependency> - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <scope>test</scope> + <groupId>com.sun.xml.bind</groupId> + <artifactId>jaxb-impl</artifactId> + <version>4.0.3</version> </dependency> - <dependency> - <groupId>org.onap.policy.common</groupId> - <artifactId>utils-test</artifactId> - <version>${policy.common.version}</version> - <scope>test</scope> + <groupId>jakarta.activation</groupId> + <artifactId>jakarta.activation-api</artifactId> + </dependency> + <dependency> + <groupId>jakarta.inject</groupId> + <artifactId>jakarta.inject-api</artifactId> + </dependency> + <dependency> + <groupId>jakarta.xml.bind</groupId> + <artifactId>jakarta.xml.bind-api</artifactId> </dependency> - </dependencies> + </project> diff --git a/policy-domains/pom.xml b/policy-domains/pom.xml index 108cf2d6..1919394c 100644 --- a/policy-domains/pom.xml +++ b/policy-domains/pom.xml @@ -20,13 +20,13 @@ --> <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.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.1-SNAPSHOT</version> </parent> <artifactId>policy-domains</artifactId> @@ -41,25 +41,6 @@ <artifactId>lombok</artifactId> <scope>provided</scope> </dependency> - - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <scope>test</scope> - </dependency> - <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> diff --git a/policy-management/pom.xml b/policy-management/pom.xml index 64e9f6b4..fb203580 100644 --- a/policy-management/pom.xml +++ b/policy-management/pom.xml @@ -20,13 +20,14 @@ ============LICENSE_END========================================================= --> -<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/maven-v4_0_0.xsd"> +<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/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.1-SNAPSHOT</version> </parent> <artifactId>policy-management</artifactId> @@ -74,7 +75,6 @@ <useRepositoryLayout>false</useRepositoryLayout> <addParentPoms>false</addParentPoms> <copyPom>false</copyPom> - <excludeGroupIds>javax.inject</excludeGroupIds> <includeScope>runtime</includeScope> </configuration> </execution> @@ -175,7 +175,7 @@ PolicyTypeController=org.onap.policy.drools.lifecycle.PolicyTypeController, Properties=java.util.Properties, ProtocolCoderToolset=org.onap.policy.drools.protocol.coders.ProtocolCoderToolset, - Response=javax.ws.rs.core.Response, + Response=jakarta.ws.rs.core.Response, TopicEndpoint=org.onap.policy.common.endpoints.event.comm.TopicEndpoint, TopicSink=org.onap.policy.common.endpoints.event.comm.TopicSink, TopicSource=org.onap.policy.common.endpoints.event.comm.TopicSource, @@ -186,10 +186,11 @@ </typeMappings> <configOptions> <sourceFolder>src/gen/java</sourceFolder> - <dateLibrary>java11</dateLibrary> + <dateLibrary>java17</dateLibrary> <interfaceOnly>true</interfaceOnly> <useTags>true</useTags> <skipIfSpecIsUnchanged>false</skipIfSpecIsUnchanged> + <jakarta>true</jakarta> </configOptions> </configuration> </execution> @@ -199,13 +200,11 @@ </build> <dependencies> - <dependency> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>policy-core</artifactId> <version>${project.version}</version> </dependency> - <dependency> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>policy-domains</artifactId> @@ -217,7 +216,11 @@ <artifactId>policy-endpoints</artifactId> <version>${policy.common.version}</version> </dependency> - + <dependency> + <groupId>org.onap.policy.common</groupId> + <artifactId>gson</artifactId> + <version>${policy.common.version}</version> + </dependency> <dependency> <groupId>org.onap.policy.common</groupId> <artifactId>utils</artifactId> @@ -234,34 +237,24 @@ <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-server</artifactId> </dependency> - <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-servlet</artifactId> </dependency> <dependency> - <groupId>org.onap.policy.common</groupId> - <artifactId>gson</artifactId> - <version>${policy.common.version}</version> - </dependency> - - <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> </dependency> - <dependency> <groupId>com.fatboyindustrial.gson-javatime-serialisers</groupId> <artifactId>gson-javatime-serialisers</artifactId> - <version>1.1.1</version> + <version>1.1.2</version> </dependency> - <dependency> <groupId>com.jayway.jsonpath</groupId> <artifactId>json-path</artifactId> </dependency> - <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-collections4</artifactId> @@ -275,37 +268,16 @@ <groupId>commons-codec</groupId> <artifactId>commons-codec</artifactId> </dependency> - <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> </dependency> - - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <scope>test</scope> - </dependency> - <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <scope>test</scope> </dependency> - <dependency> - <groupId>org.onap.policy.common</groupId> - <artifactId>utils-test</artifactId> - <version>${policy.common.version}</version> - <scope>test</scope> - </dependency> - <!-- The following dependencies are for features and drools applications usage @@ -315,54 +287,28 @@ <groupId>org.mariadb.jdbc</groupId> <artifactId>mariadb-java-client</artifactId> </dependency> - <dependency> - <groupId>org.hibernate</groupId> + <groupId>org.hibernate.orm</groupId> <artifactId>hibernate-core</artifactId> - <!-- - Exclude this because it's incompatible with eclipselink, which already - includes the same classes. - --> - <exclusions> - <exclusion> - <groupId>javax.persistence</groupId> - <artifactId>javax.persistence-api</artifactId> - </exclusion> - </exclusions> </dependency> - <dependency> <groupId>org.hibernate.common</groupId> <artifactId>hibernate-commons-annotations</artifactId> </dependency> - <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> </dependency> - <dependency> <groupId>io.prometheus</groupId> <artifactId>simpleclient_logback</artifactId> </dependency> - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.awaitility</groupId> - <artifactId>awaitility</artifactId> - <scope>test</scope> - </dependency> - <!-- Swagger v3 annotations --> <dependency> <groupId>io.swagger.core.v3</groupId> <artifactId>swagger-annotations</artifactId> </dependency> - </dependencies> + </project> diff --git a/policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java b/policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java index 11840a7e..b5cf319e 100644 --- a/policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java +++ b/policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java @@ -23,6 +23,19 @@ package org.onap.policy.drools.server.restful; import ch.qos.logback.classic.LoggerContext; import com.google.re2j.Pattern; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.DELETE; +import jakarta.ws.rs.DefaultValue; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.PUT; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.QueryParam; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.Response.Status; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; @@ -33,24 +46,12 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Properties; import java.util.UUID; import java.util.function.Function; import java.util.function.Supplier; import java.util.stream.Collectors; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.Setter; @@ -145,7 +146,8 @@ public class RestManager implements SwaggerApi, DefaultApi, FeaturesApi, InputsA public Response swagger() { try (InputStream inputStream = getClass().getResourceAsStream(SWAGGER); - BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) { + BufferedReader reader = new BufferedReader( + new InputStreamReader(Objects.requireNonNull(inputStream)))) { String contents = reader.lines() .collect(Collectors.joining(System.lineSeparator())); return Response.status(Response.Status.OK) @@ -1720,12 +1722,11 @@ public class RestManager implements SwaggerApi, DefaultApi, FeaturesApi, InputsA @Path("engine/tools/loggers") public Response loggers() { final List<String> names = new ArrayList<>(); - if (!(LoggerFactory.getILoggerFactory() instanceof LoggerContext)) { + if (!(LoggerFactory.getILoggerFactory() instanceof LoggerContext context)) { logger.warn("The SLF4J logger factory is not configured for logback"); return Response.status(Status.INTERNAL_SERVER_ERROR).entity(names).build(); } - final LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory(); for (final Logger lgr : context.getLoggerList()) { names.add(lgr.getName()); } @@ -1743,12 +1744,11 @@ public class RestManager implements SwaggerApi, DefaultApi, FeaturesApi, InputsA @Path("engine/tools/loggers/{logger}") @Produces(MediaType.TEXT_PLAIN) public Response loggerName1(@PathParam("logger") String loggerName) { - if (!(LoggerFactory.getILoggerFactory() instanceof LoggerContext)) { + if (!(LoggerFactory.getILoggerFactory() instanceof LoggerContext context)) { logger.warn("The SLF4J logger factory is not configured for logback"); return Response.status(Status.INTERNAL_SERVER_ERROR).build(); } - final LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory(); var lgr = context.getLogger(loggerName); if (lgr == null) { return Response.status(Status.NOT_FOUND).build(); diff --git a/policy-management/src/main/java/org/onap/policy/drools/server/restful/aaf/AafTelemetryAuthFilter.java b/policy-management/src/main/java/org/onap/policy/drools/server/restful/aaf/AafTelemetryAuthFilter.java index f76b3de2..1f7ef8c3 100644 --- a/policy-management/src/main/java/org/onap/policy/drools/server/restful/aaf/AafTelemetryAuthFilter.java +++ b/policy-management/src/main/java/org/onap/policy/drools/server/restful/aaf/AafTelemetryAuthFilter.java @@ -20,7 +20,7 @@ package org.onap.policy.drools.server.restful.aaf; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.onap.policy.common.utils.network.NetworkUtil; /** diff --git a/policy-management/src/main/java/org/onap/policy/drools/system/PolicyController.java b/policy-management/src/main/java/org/onap/policy/drools/system/PolicyController.java index 7501aed5..931e8a55 100644 --- a/policy-management/src/main/java/org/onap/policy/drools/system/PolicyController.java +++ b/policy-management/src/main/java/org/onap/policy/drools/system/PolicyController.java @@ -85,7 +85,7 @@ public interface PolicyController extends Startable, Lockable { <T> boolean offer(T event); /** - * Attempts delivering of an String over communication infrastructure "busType". + * Attempts delivering of a String over communication infrastructure "busType". * * @param busType bus type * @param topic topic diff --git a/policy-management/src/test/java/org/onap/policy/drools/server/restful/test/TestAafTelemetryAuthFilter.java b/policy-management/src/test/java/org/onap/policy/drools/server/restful/test/TestAafTelemetryAuthFilter.java index 67e16183..6a9be8a2 100644 --- a/policy-management/src/test/java/org/onap/policy/drools/server/restful/test/TestAafTelemetryAuthFilter.java +++ b/policy-management/src/test/java/org/onap/policy/drools/server/restful/test/TestAafTelemetryAuthFilter.java @@ -20,7 +20,7 @@ package org.onap.policy.drools.server.restful.test; -import javax.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletRequest; import org.onap.policy.common.utils.network.NetworkUtil; import org.onap.policy.drools.server.restful.aaf.AafTelemetryAuthFilter; diff --git a/policy-utils/pom.xml b/policy-utils/pom.xml index b2e3da13..e0402d35 100644 --- a/policy-utils/pom.xml +++ b/policy-utils/pom.xml @@ -29,7 +29,7 @@ <parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.1-SNAPSHOT</version> </parent> <dependencies> @@ -38,16 +38,6 @@ <artifactId>logback-classic</artifactId> </dependency> <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <scope>test</scope> - </dependency> - <dependency> <groupId>com.openpojo</groupId> <artifactId>openpojo</artifactId> <scope>test</scope> @@ -72,5 +62,13 @@ <artifactId>policy-models-tosca</artifactId> <version>${policy.models.version}</version> </dependency> + <dependency> + <groupId>com.google.guava</groupId> + <artifactId>guava</artifactId> + </dependency> + <dependency> + <groupId>com.worldturner.medeia</groupId> + <artifactId>medeia-validator-core</artifactId> + </dependency> </dependencies> </project> @@ -20,19 +20,20 @@ ============LICENSE_END========================================================= --> -<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/maven-v4_0_0.xsd"> +<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/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.onap.policy.parent</groupId> <artifactId>integration</artifactId> - <version>4.0.0-SNAPSHOT</version> - <relativePath /> + <version>4.0.1-SNAPSHOT</version> + <relativePath/> </parent> <groupId>org.onap.policy.drools-pdp</groupId> <artifactId>drools-pdp</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>2.0.1-SNAPSHOT</version> <packaging>pom</packaging> <name>policy-drools-pdp</name> @@ -48,11 +49,10 @@ <!-- Project common dependency versions --> <json.path.version>2.4.0</json.path.version> - <hibernate.core.version>5.4.28.Final</hibernate.core.version> <hibernate.commons.annotations.version>5.1.2.Final</hibernate.commons.annotations.version> <xml.apis.version>1.4.01</xml.apis.version> - <policy.common.version>2.0.0-SNAPSHOT</policy.common.version> - <policy.models.version>3.0.0-SNAPSHOT</policy.models.version> + <policy.common.version>2.0.1-SNAPSHOT</policy.common.version> + <policy.models.version>3.0.1-SNAPSHOT</policy.models.version> </properties> <modules> @@ -70,12 +70,52 @@ <module>packages</module> </modules> + <dependencies> + <dependency> + <groupId>org.onap.policy.common</groupId> + <artifactId>policy-endpoints</artifactId> + <version>${policy.common.version}</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.onap.policy.common</groupId> + <artifactId>utils</artifactId> + <version>${policy.common.version}</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.onap.policy.common</groupId> + <artifactId>utils-test</artifactId> + <version>${policy.common.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.mockito</groupId> + <artifactId>mockito-core</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.assertj</groupId> + <artifactId>assertj-core</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.awaitility</groupId> + <artifactId>awaitility</artifactId> + <scope>test</scope> + </dependency> + </dependencies> + <dependencyManagement> <dependencies> <dependency> - <groupId>javax.ws.rs</groupId> - <artifactId>javax.ws.rs-api</artifactId> - <version>2.1.1</version> + <groupId>jakarta.ws.rs</groupId> + <artifactId>jakarta.ws.rs-api</artifactId> </dependency> <dependency> <groupId>org.glassfish.hk2.external</groupId> @@ -88,11 +128,6 @@ <version>${json.path.version}</version> </dependency> <dependency> - <groupId>org.hibernate</groupId> - <artifactId>hibernate-core</artifactId> - <version>${hibernate.core.version}</version> - </dependency> - <dependency> <groupId>org.hibernate.common</groupId> <artifactId>hibernate-commons-annotations</artifactId> <version>${hibernate.commons.annotations.version}</version> @@ -134,6 +169,10 @@ </dependency> </dependencies> </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + </plugin> </plugins> </build> <reporting> @@ -141,7 +180,6 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> - <version>2.10.4</version> <configuration> <failOnError>false</failOnError> <doclet>org.umlgraph.doclet.UmlGraphDoc</doclet> diff --git a/version.properties b/version.properties index 20aa7408..07282725 100644 --- a/version.properties +++ b/version.properties @@ -4,7 +4,7 @@ minor=2 minor=0 -patch=0 +patch=1 base_version=${major}.${minor}.${patch} |