diff options
author | adheli.tavares <adheli.tavares@est.tech> | 2024-11-04 13:48:17 +0000 |
---|---|---|
committer | adheli.tavares <adheli.tavares@est.tech> | 2024-11-11 10:04:13 +0000 |
commit | 0c9ac72c3099a4b35834940da122c9708afb56e3 (patch) | |
tree | a247621a164120fb06862515b1e63c7812f35f26 | |
parent | 16f3bbb1eea5106d6ad40f119d4ac606f031f9d8 (diff) |
Fix references and organize dependencies in policy-drools after
splitting policy-endpoints and message-bus in policy-common
Issue-ID: POLICY-5131
Change-Id: Ia10b2e1860c5300fcf4953d105901f920af88576
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
17 files changed, 212 insertions, 155 deletions
diff --git a/controlloop/common/controller-usecases/pom.xml b/controlloop/common/controller-usecases/pom.xml index e5443eb60..3547aafc1 100644 --- a/controlloop/common/controller-usecases/pom.xml +++ b/controlloop/common/controller-usecases/pom.xml @@ -205,6 +205,11 @@ <artifactId>drools-model-compiler</artifactId> <version>${version.drools}</version> </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-test</artifactId> + <scope>test</scope> + </dependency> </dependencies> <profiles> diff --git a/controlloop/common/coordination/pom.xml b/controlloop/common/coordination/pom.xml index 51e02d94a..9b0f21b2e 100644 --- a/controlloop/common/coordination/pom.xml +++ b/controlloop/common/coordination/pom.xml @@ -4,7 +4,7 @@ ================================================================================ Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved. Modifications Copyright (C) 2020 Bell Canada. - Modifications Copyright (C) 2023 Nordix Foundation. + Modifications Copyright (C) 2023-2024 Nordix Foundation. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -38,5 +38,21 @@ <version>${version.policy.drools-pdp}</version> <scope>provided</scope> </dependency> + <dependency> + <groupId>org.yaml</groupId> + <artifactId>snakeyaml</artifactId> + </dependency> + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + </dependency> + <dependency> + <groupId>org.projectlombok</groupId> + <artifactId>lombok</artifactId> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + </dependency> </dependencies> </project> diff --git a/controlloop/common/eventmanager/pom.xml b/controlloop/common/eventmanager/pom.xml index c67021c47..e576be904 100644 --- a/controlloop/common/eventmanager/pom.xml +++ b/controlloop/common/eventmanager/pom.xml @@ -34,18 +34,40 @@ <dependencies> <dependency> - <groupId>org.hibernate.orm</groupId> - <artifactId>hibernate-core</artifactId> + <groupId>org.onap.policy.drools-pdp</groupId> + <artifactId>policy-core</artifactId> + <version>${version.policy.drools-pdp}</version> </dependency> <dependency> - <groupId>commons-io</groupId> - <artifactId>commons-io</artifactId> - <scope>provided</scope> + <groupId>org.onap.policy.drools-pdp</groupId> + <artifactId>policy-utils</artifactId> + <version>${version.policy.drools-pdp}</version> </dependency> <dependency> - <!-- less than 1.9.4 has security vulnerabilities --> - <groupId>commons-beanutils</groupId> - <artifactId>commons-beanutils</artifactId> + <groupId>org.onap.policy.drools-pdp</groupId> + <artifactId>policy-management</artifactId> + <version>${version.policy.drools-pdp}</version> + </dependency> + <dependency> + <groupId>org.onap.policy.drools-pdp</groupId> + <artifactId>policy-domains</artifactId> + <version>${version.policy.drools-pdp}</version> + </dependency> + <dependency> + <groupId>org.onap.policy.models</groupId> + <artifactId>policy-models-decisions</artifactId> + <version>${policy.models.version}</version> + </dependency> + <dependency> + <groupId>org.onap.policy.models</groupId> + <artifactId>policy-models-examples</artifactId> + <version>${policy.models.version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.onap.policy.models</groupId> + <artifactId>policy-models-tosca</artifactId> + <version>${policy.models.version}</version> </dependency> <dependency> <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId> @@ -159,11 +181,6 @@ <artifactId>blueprint-proto</artifactId> </dependency> <dependency> - <groupId>com.google.code.gson</groupId> - <artifactId>gson</artifactId> - <scope>provided</scope> - </dependency> - <dependency> <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId> <artifactId>aai</artifactId> <version>${policy.models.version}</version> @@ -176,32 +193,25 @@ <scope>provided</scope> </dependency> <dependency> - <groupId>org.onap.policy.models</groupId> - <artifactId>policy-models-decisions</artifactId> + <groupId>org.onap.policy.models.policy-models-interactions</groupId> + <artifactId>simulators</artifactId> <version>${policy.models.version}</version> + <scope>test</scope> </dependency> <dependency> - <groupId>org.apache.httpcomponents.client5</groupId> - <artifactId>httpclient5</artifactId> - <scope>provided</scope> + <groupId>org.onap.policy.common</groupId> + <artifactId>common-parameters</artifactId> + <version>${version.policy.common}</version> </dependency> <dependency> <groupId>org.onap.policy.common</groupId> <artifactId>policy-endpoints</artifactId> <version>${version.policy.common}</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.onap.policy.drools-pdp</groupId> - <artifactId>policy-management</artifactId> - <version>${version.policy.drools-pdp}</version> - <scope>provided</scope> </dependency> <dependency> - <groupId>org.onap.policy.drools-pdp</groupId> - <artifactId>policy-domains</artifactId> - <version>${version.policy.drools-pdp}</version> - <scope>provided</scope> + <groupId>org.onap.policy.common</groupId> + <artifactId>utils</artifactId> + <version>${version.policy.common}</version> </dependency> <dependency> <groupId>org.onap.policy.common</groupId> @@ -210,21 +220,58 @@ <scope>test</scope> </dependency> <dependency> - <groupId>org.onap.policy.models.policy-models-interactions</groupId> - <artifactId>simulators</artifactId> - <version>${policy.models.version}</version> - <scope>test</scope> + <groupId>org.hibernate.orm</groupId> + <artifactId>hibernate-core</artifactId> + <scope>runtime</scope> </dependency> <dependency> - <groupId>org.onap.policy.models</groupId> - <artifactId>policy-models-examples</artifactId> - <version>${policy.models.version}</version> - <scope>test</scope> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <scope>provided</scope> </dependency> <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <scope>test</scope> </dependency> + <dependency> + <groupId>org.awaitility</groupId> + <artifactId>awaitility</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>com.openpojo</groupId> + <artifactId>openpojo</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>jakarta.persistence</groupId> + <artifactId>jakarta.persistence-api</artifactId> + </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-lang3</artifactId> + </dependency> + <dependency> + <groupId>org.drools</groupId> + <artifactId>drools-core</artifactId> + </dependency> + <dependency> + <groupId>org.kie</groupId> + <artifactId>kie-api</artifactId> + </dependency> + <dependency> + <groupId>org.mockito</groupId> + <artifactId>mockito-core</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.projectlombok</groupId> + <artifactId>lombok</artifactId> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + </dependency> </dependencies> </project> diff --git a/controlloop/common/feature-controlloop-management/pom.xml b/controlloop/common/feature-controlloop-management/pom.xml index a2e6a609e..537c3fbb3 100644 --- a/controlloop/common/feature-controlloop-management/pom.xml +++ b/controlloop/common/feature-controlloop-management/pom.xml @@ -3,7 +3,7 @@ ONAP ================================================================================ Copyright (C) 2018-2021 AT&T Intellectual Property. All rights reserved. - Modifications Copyright (C) 2019,2023 Nordix Foundation. + Modifications Copyright (C) 2019, 2023-2024 Nordix Foundation. Modifications Copyright (C) 2020 Bell Canada. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); @@ -314,5 +314,15 @@ <version>${policy.models.version}</version> <scope>test</scope> </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-test</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.awaitility</groupId> + <artifactId>awaitility</artifactId> + <scope>test</scope> + </dependency> </dependencies> </project> diff --git a/controlloop/common/feature-controlloop-trans/pom.xml b/controlloop/common/feature-controlloop-trans/pom.xml index fb72730fa..9fe73dcff 100644 --- a/controlloop/common/feature-controlloop-trans/pom.xml +++ b/controlloop/common/feature-controlloop-trans/pom.xml @@ -3,7 +3,7 @@ ONAP ================================================================================ Copyright (C) 2018-2021 AT&T Intellectual Property. All rights reserved. - Modifications Copyright (C) 2019,2023 Nordix Foundation. + Modifications Copyright (C) 2019, 2023-2024 Nordix Foundation. Modifications Copyright (C) 2020 Bell Canada. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); @@ -149,5 +149,10 @@ <artifactId>guava</artifactId> <scope>provided</scope> </dependency> + <dependency> + <groupId>org.awaitility</groupId> + <artifactId>awaitility</artifactId> + <scope>test</scope> + </dependency> </dependencies> </project> diff --git a/controlloop/common/feature-controlloop-trans/src/main/java/org/onap/policy/drools/apps/controlloop/feature/trans/ControlLoopMetricsFeature.java b/controlloop/common/feature-controlloop-trans/src/main/java/org/onap/policy/drools/apps/controlloop/feature/trans/ControlLoopMetricsFeature.java index 26627eb1c..f3235ba43 100644 --- a/controlloop/common/feature-controlloop-trans/src/main/java/org/onap/policy/drools/apps/controlloop/feature/trans/ControlLoopMetricsFeature.java +++ b/controlloop/common/feature-controlloop-trans/src/main/java/org/onap/policy/drools/apps/controlloop/feature/trans/ControlLoopMetricsFeature.java @@ -3,6 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2024 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,7 +21,7 @@ package org.onap.policy.drools.apps.controlloop.feature.trans; -import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure; +import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure; import org.onap.policy.controlloop.VirtualControlLoopNotification; import org.onap.policy.drools.features.PolicyControllerFeatureApi; import org.onap.policy.drools.system.PolicyController; diff --git a/controlloop/common/feature-controlloop-trans/src/test/java/org/onap/policy/drools/apps/controlloop/feature/trans/ControlLoopMetricsFeatureTest.java b/controlloop/common/feature-controlloop-trans/src/test/java/org/onap/policy/drools/apps/controlloop/feature/trans/ControlLoopMetricsFeatureTest.java index 164cdb733..a165f35f8 100644 --- a/controlloop/common/feature-controlloop-trans/src/test/java/org/onap/policy/drools/apps/controlloop/feature/trans/ControlLoopMetricsFeatureTest.java +++ b/controlloop/common/feature-controlloop-trans/src/test/java/org/onap/policy/drools/apps/controlloop/feature/trans/ControlLoopMetricsFeatureTest.java @@ -36,7 +36,7 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure; +import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure; import org.onap.policy.common.utils.resources.ResourceUtils; import org.onap.policy.controlloop.ControlLoopNotificationType; import org.onap.policy.controlloop.VirtualControlLoopNotification; diff --git a/controlloop/common/feature-controlloop-trans/src/test/java/org/onap/policy/drools/server/restful/RestTransactionTrackerTest.java b/controlloop/common/feature-controlloop-trans/src/test/java/org/onap/policy/drools/server/restful/RestTransactionTrackerTest.java index ac73f93dc..19d09e0ca 100644 --- a/controlloop/common/feature-controlloop-trans/src/test/java/org/onap/policy/drools/server/restful/RestTransactionTrackerTest.java +++ b/controlloop/common/feature-controlloop-trans/src/test/java/org/onap/policy/drools/server/restful/RestTransactionTrackerTest.java @@ -33,11 +33,11 @@ import java.util.List; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.onap.policy.common.endpoints.event.comm.Topic; -import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams; import org.onap.policy.common.endpoints.http.client.HttpClient; import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance; import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance; +import org.onap.policy.common.message.bus.event.Topic; +import org.onap.policy.common.parameters.topic.BusTopicParams; import org.onap.policy.common.utils.network.NetworkUtil; import org.onap.policy.common.utils.resources.ResourceUtils; import org.onap.policy.controlloop.VirtualControlLoopNotification; @@ -96,14 +96,14 @@ class RestTransactionTrackerTest { equals(get("cacheSize", Response.Status.OK.getStatusCode()), Integer.class, 3); equals(get("timeout", Response.Status.OK.getStatusCode()), Integer.class, 2); - put("cacheSize/10", "", Response.Status.OK.getStatusCode()); - put("timeout/20", "", Response.Status.OK.getStatusCode()); + put("cacheSize/10", Response.Status.OK.getStatusCode()); + put("timeout/20", Response.Status.OK.getStatusCode()); equals(get("cacheSize", Response.Status.OK.getStatusCode()), Integer.class, 10); equals(get("timeout", Response.Status.OK.getStatusCode()), Integer.class, 20); - put("cacheSize/3", "", Response.Status.OK.getStatusCode()); - put("timeout/2", "", Response.Status.OK.getStatusCode()); + put("cacheSize/3", Response.Status.OK.getStatusCode()); + put("timeout/2", Response.Status.OK.getStatusCode()); equals(get("cacheSize", Response.Status.OK.getStatusCode()), Integer.class, 3); equals(get("timeout", Response.Status.OK.getStatusCode()), Integer.class, 2); @@ -127,30 +127,31 @@ class RestTransactionTrackerTest { assertFalse(HttpClient.getBody(get("/inprogress", Response.Status.OK.getStatusCode()), List.class).isEmpty()); - notNull(get("/inprogress/664be3d2-6c12-4f4b-a3e7-c349acced200", Response.Status.OK.getStatusCode()), - String.class); + notNull(get("/inprogress/664be3d2-6c12-4f4b-a3e7-c349acced200", Response.Status.OK.getStatusCode()) + ); } private Response get(String contextPath, int statusCode) { var response = client.get(contextPath); - return checkResponse(statusCode, response); + checkResponse(statusCode, response); + return response; } - private Response put(String contextPath, String body, int statusCode) { - var response = client.put(contextPath, Entity.json(body), Collections.emptyMap()); - return checkResponse(statusCode, response); + private void put(String contextPath, int statusCode) { + var response = client.put(contextPath, Entity.json(""), Collections.emptyMap()); + checkResponse(statusCode, response); + response.close(); } private <T, Y> void equals(Response response, Class<T> clazz, Y expected) { assertEquals(expected, HttpClient.getBody(response, clazz)); } - private <T> void notNull(Response response, Class<T> clazz) { - assertNotNull(HttpClient.getBody(response, clazz)); + private <T> void notNull(Response response) { + assertNotNull(HttpClient.getBody(response, (Class<T>) String.class)); } - private Response checkResponse(int statusCode, Response response) { + private void checkResponse(int statusCode, Response response) { assertEquals(statusCode, response.getStatus()); - return response; } }
\ No newline at end of file diff --git a/controlloop/common/feature-controlloop-usecases/pom.xml b/controlloop/common/feature-controlloop-usecases/pom.xml index d3ea3e3fe..629d261fc 100644 --- a/controlloop/common/feature-controlloop-usecases/pom.xml +++ b/controlloop/common/feature-controlloop-usecases/pom.xml @@ -4,7 +4,7 @@ ================================================================================ Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved. Modifications Copyright (C) 2020 Bell Canada. - Modifications Copyright (C) 2023 Nordix Foundation. + Modifications Copyright (C) 2023-2024 Nordix Foundation. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -107,10 +107,5 @@ <version>${version.policy.drools-pdp}</version> <scope>provided</scope> </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> - </dependency> </dependencies> </project> diff --git a/controlloop/common/feature-controlloop-utils/pom.xml b/controlloop/common/feature-controlloop-utils/pom.xml index ad9a296a4..c5805abfa 100644 --- a/controlloop/common/feature-controlloop-utils/pom.xml +++ b/controlloop/common/feature-controlloop-utils/pom.xml @@ -3,15 +3,15 @@ ONAP ================================================================================ Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. - Modifications Copyright (C) 2019, 2023 Nordix Foundation. + Modifications Copyright (C) 2019, 2023-2024 Nordix Foundation. Modifications Copyright (C) 2020 Bell Canada. ================================================================================ 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. diff --git a/controlloop/common/pom.xml b/controlloop/common/pom.xml index ab8cb934a..f9b739289 100644 --- a/controlloop/common/pom.xml +++ b/controlloop/common/pom.xml @@ -4,7 +4,7 @@ ================================================================================ Copyright (C) 2017, 2019-2020 AT&T Intellectual Property. All rights reserved. Modifications Copyright (C) 2020 Bell Canada. - Modifications Copyright (C) 2023 Nordix Foundation. + Modifications Copyright (C) 2023-2024 Nordix Foundation. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -45,4 +45,30 @@ <module>feature-controlloop-usecases</module> </modules> + <dependencies> + <dependency> + <groupId>org.kie</groupId> + <artifactId>kie-ci</artifactId> + </dependency> + <dependency> + <groupId>ch.qos.logback</groupId> + <artifactId>logback-classic</artifactId> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>io.swagger.core.v3</groupId> + <artifactId>swagger-annotations</artifactId> + </dependency> + <dependency> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter-api</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.assertj</groupId> + <artifactId>assertj-core</artifactId> + <scope>test</scope> + </dependency> + </dependencies> + </project> diff --git a/controlloop/common/rules-test/pom.xml b/controlloop/common/rules-test/pom.xml index 2b945496f..947f29533 100644 --- a/controlloop/common/rules-test/pom.xml +++ b/controlloop/common/rules-test/pom.xml @@ -53,6 +53,11 @@ <scope>provided</scope> </dependency> <dependency> + <groupId>org.onap.policy.common</groupId> + <artifactId>message-bus</artifactId> + <version>${version.policy.common}</version> + </dependency> + <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <scope>provided</scope> diff --git a/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/Listener.java b/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/Listener.java index 5110fe7b9..0f917ca50 100644 --- a/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/Listener.java +++ b/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/Listener.java @@ -3,6 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2024 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,11 +27,11 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.function.Function; import java.util.function.Predicate; -import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure; -import org.onap.policy.common.endpoints.event.comm.TopicEndpoint; -import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager; -import org.onap.policy.common.endpoints.event.comm.TopicListener; -import org.onap.policy.common.endpoints.event.comm.TopicSink; +import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure; +import org.onap.policy.common.message.bus.event.TopicEndpoint; +import org.onap.policy.common.message.bus.event.TopicEndpointManager; +import org.onap.policy.common.message.bus.event.TopicListener; +import org.onap.policy.common.message.bus.event.TopicSink; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/Topics.java b/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/Topics.java index 051270f6f..c7a339df4 100644 --- a/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/Topics.java +++ b/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/Topics.java @@ -3,6 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2024 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,8 +26,8 @@ import java.io.IOException; import java.util.LinkedList; import java.util.List; import java.util.function.Function; -import org.onap.policy.common.endpoints.event.comm.TopicEndpoint; -import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager; +import org.onap.policy.common.message.bus.event.TopicEndpoint; +import org.onap.policy.common.message.bus.event.TopicEndpointManager; import org.onap.policy.common.utils.coder.Coder; import org.onap.policy.common.utils.coder.CoderException; import org.onap.policy.common.utils.resources.ResourceUtils; diff --git a/controlloop/common/rules-test/src/test/java/org/onap/policy/controlloop/common/rules/test/ListenerTest.java b/controlloop/common/rules-test/src/test/java/org/onap/policy/controlloop/common/rules/test/ListenerTest.java index ed30515bc..614e76899 100644 --- a/controlloop/common/rules-test/src/test/java/org/onap/policy/controlloop/common/rules/test/ListenerTest.java +++ b/controlloop/common/rules-test/src/test/java/org/onap/policy/controlloop/common/rules/test/ListenerTest.java @@ -3,7 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2023 Nordix Foundation. + * Modifications Copyright (C) 2023-2024 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,11 +39,11 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure; -import org.onap.policy.common.endpoints.event.comm.TopicEndpoint; -import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager; -import org.onap.policy.common.endpoints.event.comm.bus.NoopTopicSink; -import org.onap.policy.common.endpoints.parameters.TopicParameters; +import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure; +import org.onap.policy.common.message.bus.event.TopicEndpoint; +import org.onap.policy.common.message.bus.event.TopicEndpointManager; +import org.onap.policy.common.message.bus.event.noop.NoopTopicSink; +import org.onap.policy.common.parameters.topic.TopicParameters; class ListenerTest { private static final String EXPECTED_EXCEPTION = "expected exception"; @@ -139,7 +139,7 @@ class ListenerTest { */ @Test void testAwaitLongTimeUnitPredicateInterrupted() throws InterruptedException { - listener = new Listener<String>(MY_TOPIC, msg -> msg) { + listener = new Listener<>(MY_TOPIC, msg -> msg) { @Override protected String pollMessage(long remainingMs) throws InterruptedException { throw new InterruptedException(EXPECTED_EXCEPTION); @@ -149,20 +149,17 @@ class ListenerTest { AtomicReference<TopicException> exref = new AtomicReference<>(); var interrupted = new CountDownLatch(1); - var thread = new Thread() { - @Override - public void run() { - try { - listener.await(); - } catch (TopicException e) { - exref.set(e); - } - - if (Thread.currentThread().isInterrupted()) { - interrupted.countDown(); - } + var thread = new Thread(() -> { + try { + listener.await(); + } catch (TopicException e) { + exref.set(e); } - }; + + if (Thread.currentThread().isInterrupted()) { + interrupted.countDown(); + } + }); thread.start(); assertTrue(interrupted.await(5, TimeUnit.SECONDS)); diff --git a/controlloop/common/rules-test/src/test/java/org/onap/policy/controlloop/common/rules/test/TopicsTest.java b/controlloop/common/rules-test/src/test/java/org/onap/policy/controlloop/common/rules/test/TopicsTest.java index 9bf0d22b7..00335616c 100644 --- a/controlloop/common/rules-test/src/test/java/org/onap/policy/controlloop/common/rules/test/TopicsTest.java +++ b/controlloop/common/rules-test/src/test/java/org/onap/policy/controlloop/common/rules/test/TopicsTest.java @@ -3,7 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2023 Nordix Foundation. + * Modifications Copyright (C) 2023-2024 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,12 +39,12 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure; -import org.onap.policy.common.endpoints.event.comm.TopicEndpoint; -import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager; -import org.onap.policy.common.endpoints.event.comm.bus.NoopTopicSink; -import org.onap.policy.common.endpoints.event.comm.bus.NoopTopicSource; -import org.onap.policy.common.endpoints.parameters.TopicParameters; +import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure; +import org.onap.policy.common.message.bus.event.TopicEndpoint; +import org.onap.policy.common.message.bus.event.TopicEndpointManager; +import org.onap.policy.common.message.bus.event.noop.NoopTopicSink; +import org.onap.policy.common.message.bus.event.noop.NoopTopicSource; +import org.onap.policy.common.parameters.topic.TopicParameters; import org.onap.policy.common.utils.coder.CoderException; import org.onap.policy.common.utils.coder.StandardCoder; import org.onap.policy.drools.controller.DroolsController; @@ -114,57 +114,4 @@ </plugins> </reporting> - <dependencies> - <dependency> - <groupId>org.kie</groupId> - <artifactId>kie-ci</artifactId> - </dependency> - - <dependency> - <groupId>ch.qos.logback</groupId> - <artifactId>logback-classic</artifactId> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.junit.jupiter</groupId> - <artifactId>junit-jupiter-api</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.junit.jupiter</groupId> - <artifactId>junit-jupiter-engine</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-junit-jupiter</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-test</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> - - <!-- Swagger v3 annotations --> - <dependency> - <groupId>io.swagger.core.v3</groupId> - <artifactId>swagger-annotations</artifactId> - </dependency> - </dependencies> </project> |