From 8d77c3ac069ecb0eb685f8ad3e5c560a15e6e184 Mon Sep 17 00:00:00 2001 From: "adheli.tavares" Date: Mon, 4 Nov 2024 10:26:34 +0000 Subject: [PATCH] Fix references and organize dependencies in policy-pap after splitting policy-endpoints and message-bus in policy-common Issue-ID: POLICY-5131 Change-Id: Icddef2327ad78bd07ad1ded578ba20e924d1ec73 Signed-off-by: adheli.tavares --- main/pom.xml | 268 +++++++++++++++--- .../pap/main/comm/MultiPdpStatusListener.java | 5 +- .../pap/main/comm/PdpHeartbeatListener.java | 2 +- .../onap/policy/pap/main/comm/Publisher.java | 5 +- .../pap/main/comm/msgdata/RequestImpl.java | 4 +- .../main/parameters/PapParameterGroup.java | 6 +- .../pap/main/rest/HealthCheckProvider.java | 4 +- .../rest/HealthCheckRestControllerV1.java | 4 +- .../PolicyComponentsHealthCheckProvider.java | 16 +- .../stub/HealthCheckRestControllerV1Stub.java | 4 +- .../pap/main/startstop/PapActivator.java | 8 +- .../pap/main/comm/CommonRequestBase.java | 4 +- .../main/comm/MultiPdpStatusListenerTest.java | 4 +- .../main/comm/PdpHeartbeatListenerTest.java | 4 +- .../policy/pap/main/comm/PublisherTest.java | 6 +- .../parameters/TestPapParameterGroup.java | 4 +- .../pap/main/rest/CommonPapRestServer.java | 2 +- .../rest/TestHealthCheckRestControllerV1.java | 4 +- ...licyComponentsHealthCheckControllerV1.java | 4 +- ...stPolicyComponentsHealthCheckProvider.java | 2 +- .../pap/main/rest/e2e/End2EndContext.java | 8 +- .../pap/main/rest/e2e/HealthCheckTest.java | 4 +- .../pap/main/rest/e2e/PdpGroupDeleteTest.java | 6 +- .../pap/main/rest/e2e/PdpGroupDeployTest.java | 4 +- .../pap/main/startstop/TestPapActivator.java | 4 +- 25 files changed, 294 insertions(+), 92 deletions(-) diff --git a/main/pom.xml b/main/pom.xml index e0b3fdccd..1e7e37043 100644 --- a/main/pom.xml +++ b/main/pom.xml @@ -20,7 +20,8 @@ ============LICENSE_END========================================================= --> - + 4.0.0 org.onap.policy.pap @@ -31,23 +32,35 @@ pap-main ${project.artifactId} - The main module of Policy Administration Backend that handles startup, lifecycle management, and parameters. + The main module of Policy Administration Backend that handles startup, lifecycle management, and + parameters. + org.onap.policy.common - policy-endpoints + capabilities ${policy.common.version} - org.onap.policy.models - policy-models-pap - ${policy.models.version} + org.onap.policy.common + common-parameters + ${policy.common.version} - org.onap.policy.models - policy-models-pdp - ${policy.models.version} + org.onap.policy.common + gson + ${policy.common.version} + + + org.onap.policy.common + message-bus + ${policy.common.version} + + + org.onap.policy.common + policy-endpoints + ${policy.common.version} org.onap.policy.common @@ -56,41 +69,146 @@ org.onap.policy.common - utils-test + utils ${policy.common.version} - test - org.bouncycastle - bcpkix-fips + org.onap.policy.models + policy-models-base + ${policy.models.version} + + + org.onap.policy.models + policy-models-errors + ${policy.models.version} + + + org.onap.policy.models + policy-models-pap + ${policy.models.version} + + + org.onap.policy.models + policy-models-pdp + ${policy.models.version} + + + org.onap.policy.models + policy-models-tosca + ${policy.models.version} + + + com.google.code.gson + gson + provided com.google.guava guava + runtime - org.springframework.boot - spring-boot-starter-web + com.google.re2j + re2j + provided - org.springframework.boot - spring-boot-starter-tomcat + io.micrometer + micrometer-core - org.springframework.boot - spring-boot-starter-data-jpa + io.swagger.core.v3 + swagger-annotations-jakarta - org.springframework.boot - spring-boot-starter-security + io.swagger.core.v3 + swagger-models-jakarta + + + jakarta.annotation + jakarta.annotation-api + + + jakarta.validation + jakarta.validation-api + + + jakarta.ws.rs + jakarta.ws.rs-api + + + org.apache.commons + commons-lang3 + + + org.aspectj + aspectjweaver + + + org.eclipse.jetty.toolchain + jetty-jakarta-servlet-api + + + org.projectlombok + lombok + provided + + + org.slf4j + slf4j-api + provided + + + org.springframework + spring-beans + + + org.springframework + spring-context + + + org.springframework + spring-core + + + org.springframework + spring-tx + + + org.springframework + spring-web + + + org.springframework + spring-webmvc org.springframework.boot - spring-boot-starter-aop + spring-boot org.springframework.boot - spring-boot-starter-actuator + spring-boot-autoconfigure + + + org.springframework.data + spring-data-commons + + + org.springframework.data + spring-data-jpa + + + org.springframework.security + spring-security-config + + + org.springframework.security + spring-security-core + + + org.springframework.security + spring-security-web io.micrometer @@ -100,20 +218,72 @@ org.apache.kafka kafka-clients - provided + runtime + + + org.apache.tomcat.embed + tomcat-embed-core + runtime + + + org.glassfish.jersey.core + jersey-client + runtime + + + org.hibernate.orm + hibernate-core + runtime + + + org.postgresql + postgresql + runtime org.springdoc springdoc-openapi-starter-webmvc-ui + runtime - org.apache.tomcat.embed - tomcat-embed-core + org.springframework.boot + spring-boot-starter-actuator + runtime - - org.mockito - mockito-core + org.springframework.boot + spring-boot-starter-aop + runtime + + + org.springframework.boot + spring-boot-starter-data-jpa + runtime + + + org.springframework.boot + spring-boot-starter-security + runtime + + + org.springframework.boot + spring-boot-starter-tomcat + runtime + + + org.springframework.boot + spring-boot-starter-web + runtime + + + org.yaml + snakeyaml + runtime + + + org.onap.policy.common + utils-test + ${policy.common.version} test @@ -122,13 +292,13 @@ test - org.springframework.security - spring-security-test + org.assertj + assertj-core test - org.springframework.boot - spring-boot-starter-test + org.junit.jupiter + junit-jupiter-api test @@ -136,11 +306,41 @@ junit-jupiter-engine test + + org.mockito + mockito-core + test + org.mockito mockito-junit-jupiter test + + org.springframework + spring-test + test + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.boot + spring-boot-test + test + + + org.springframework.boot + spring-boot-test-autoconfigure + test + + + org.springframework.security + spring-security-test + test + @@ -180,7 +380,7 @@ false false - HealthCheckReport=org.onap.policy.common.endpoints.report.HealthCheckReport, + HealthCheckReport=org.onap.policy.common.utils.report.HealthCheckReport, Pdps=org.onap.policy.models.pdp.concepts.Pdps, PdpState=org.onap.policy.models.pdp.enums.PdpState, PdpGroupUpdateResponse=org.onap.policy.models.pap.concepts.PdpGroupUpdateResponse, diff --git a/main/src/main/java/org/onap/policy/pap/main/comm/MultiPdpStatusListener.java b/main/src/main/java/org/onap/policy/pap/main/comm/MultiPdpStatusListener.java index 65f448e28..137f9802f 100644 --- a/main/src/main/java/org/onap/policy/pap/main/comm/MultiPdpStatusListener.java +++ b/main/src/main/java/org/onap/policy/pap/main/comm/MultiPdpStatusListener.java @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2020 Bell Canada. 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. @@ -28,15 +29,15 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure; import org.onap.policy.common.endpoints.listeners.TypedMessageListener; +import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure; import org.onap.policy.models.pdp.concepts.PdpStatus; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Listener for PDP Status messages expected to be received from multiple PDPs. The - * listener "completes" once a message has been seen from all of the PDPs. + * listener "completes" once a message has been seen from all PDPs. */ public abstract class MultiPdpStatusListener implements TypedMessageListener { private static final Logger logger = LoggerFactory.getLogger(MultiPdpStatusListener.class); diff --git a/main/src/main/java/org/onap/policy/pap/main/comm/PdpHeartbeatListener.java b/main/src/main/java/org/onap/policy/pap/main/comm/PdpHeartbeatListener.java index abf28d797..99f8d1664 100644 --- a/main/src/main/java/org/onap/policy/pap/main/comm/PdpHeartbeatListener.java +++ b/main/src/main/java/org/onap/policy/pap/main/comm/PdpHeartbeatListener.java @@ -23,8 +23,8 @@ package org.onap.policy.pap.main.comm; import lombok.NoArgsConstructor; -import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure; import org.onap.policy.common.endpoints.listeners.TypedMessageListener; +import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure; import org.onap.policy.models.pdp.concepts.PdpStatus; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; diff --git a/main/src/main/java/org/onap/policy/pap/main/comm/Publisher.java b/main/src/main/java/org/onap/policy/pap/main/comm/Publisher.java index 27c3b053f..a45af0e5a 100644 --- a/main/src/main/java/org/onap/policy/pap/main/comm/Publisher.java +++ b/main/src/main/java/org/onap/policy/pap/main/comm/Publisher.java @@ -3,6 +3,7 @@ * ONAP PAP * ================================================================================ * Copyright (C) 2019-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. @@ -22,8 +23,8 @@ import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; -import org.onap.policy.common.endpoints.event.comm.client.TopicSinkClient; -import org.onap.policy.common.endpoints.event.comm.client.TopicSinkClientException; +import org.onap.policy.common.message.bus.event.client.TopicSinkClient; +import org.onap.policy.common.message.bus.event.client.TopicSinkClientException; import org.onap.policy.common.utils.coder.StandardCoder; import org.onap.policy.pap.main.PolicyPapException; import org.slf4j.Logger; diff --git a/main/src/main/java/org/onap/policy/pap/main/comm/msgdata/RequestImpl.java b/main/src/main/java/org/onap/policy/pap/main/comm/msgdata/RequestImpl.java index ff1614696..b1cc18149 100644 --- a/main/src/main/java/org/onap/policy/pap/main/comm/msgdata/RequestImpl.java +++ b/main/src/main/java/org/onap/policy/pap/main/comm/msgdata/RequestImpl.java @@ -4,7 +4,7 @@ * ================================================================================ * Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2020 Bell Canada. All rights reserved. - * Modifications Copyright (C) 2021 Nordix Foundation. + * Modifications Copyright (C) 2021, 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. @@ -28,7 +28,7 @@ import lombok.Getter; import lombok.NonNull; import lombok.Setter; -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.services.ServiceManager; import org.onap.policy.models.pdp.concepts.PdpMessage; import org.onap.policy.models.pdp.concepts.PdpStatus; diff --git a/main/src/main/java/org/onap/policy/pap/main/parameters/PapParameterGroup.java b/main/src/main/java/org/onap/policy/pap/main/parameters/PapParameterGroup.java index 8bee9786b..a2c94fca8 100644 --- a/main/src/main/java/org/onap/policy/pap/main/parameters/PapParameterGroup.java +++ b/main/src/main/java/org/onap/policy/pap/main/parameters/PapParameterGroup.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. + * Copyright (C) 2019, 2024 Nordix Foundation. * Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property. * Modifications Copyright (C) 2021-2023 Bell Canada. All rights reserved. * ================================================================================ @@ -25,12 +25,12 @@ import java.util.List; import lombok.Getter; import lombok.Setter; -import org.onap.policy.common.endpoints.parameters.RestClientParameters; -import org.onap.policy.common.endpoints.parameters.TopicParameterGroup; import org.onap.policy.common.parameters.ParameterGroupImpl; import org.onap.policy.common.parameters.annotations.NotBlank; import org.onap.policy.common.parameters.annotations.NotNull; import org.onap.policy.common.parameters.annotations.Valid; +import org.onap.policy.common.parameters.rest.RestClientParameters; +import org.onap.policy.common.parameters.topic.TopicParameterGroup; import org.onap.policy.common.parameters.validation.ParameterGroupConstraint; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Configuration; diff --git a/main/src/main/java/org/onap/policy/pap/main/rest/HealthCheckProvider.java b/main/src/main/java/org/onap/policy/pap/main/rest/HealthCheckProvider.java index f7cfb363d..2cb2435e3 100644 --- a/main/src/main/java/org/onap/policy/pap/main/rest/HealthCheckProvider.java +++ b/main/src/main/java/org/onap/policy/pap/main/rest/HealthCheckProvider.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. + * Copyright (C) 2019, 2024 Nordix Foundation. * Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property. * Modifications Copyright (C) 2021-2022 Bell Canada. All rights reserved. * ================================================================================ @@ -22,8 +22,8 @@ package org.onap.policy.pap.main.rest; -import org.onap.policy.common.endpoints.report.HealthCheckReport; import org.onap.policy.common.utils.network.NetworkUtil; +import org.onap.policy.common.utils.report.HealthCheckReport; import org.onap.policy.common.utils.services.Registry; import org.onap.policy.models.base.PfModelRuntimeException; import org.onap.policy.pap.main.PapConstants; diff --git a/main/src/main/java/org/onap/policy/pap/main/rest/HealthCheckRestControllerV1.java b/main/src/main/java/org/onap/policy/pap/main/rest/HealthCheckRestControllerV1.java index 8d4fd4b2c..4279e6843 100644 --- a/main/src/main/java/org/onap/policy/pap/main/rest/HealthCheckRestControllerV1.java +++ b/main/src/main/java/org/onap/policy/pap/main/rest/HealthCheckRestControllerV1.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2019-2023 Nordix Foundation. + * Copyright (C) 2019-2024 Nordix Foundation. * Modifications Copyright (C) 2019 AT&T Intellectual Property. * Modifications Copyright (C) 2021-2022 Bell Canada. All rights reserved. * ================================================================================ @@ -23,7 +23,7 @@ package org.onap.policy.pap.main.rest; import lombok.RequiredArgsConstructor; -import org.onap.policy.common.endpoints.report.HealthCheckReport; +import org.onap.policy.common.utils.report.HealthCheckReport; import org.springframework.context.annotation.Profile; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; diff --git a/main/src/main/java/org/onap/policy/pap/main/rest/PolicyComponentsHealthCheckProvider.java b/main/src/main/java/org/onap/policy/pap/main/rest/PolicyComponentsHealthCheckProvider.java index 32d431431..c34853084 100644 --- a/main/src/main/java/org/onap/policy/pap/main/rest/PolicyComponentsHealthCheckProvider.java +++ b/main/src/main/java/org/onap/policy/pap/main/rest/PolicyComponentsHealthCheckProvider.java @@ -46,8 +46,8 @@ import org.onap.policy.common.endpoints.http.client.HttpClientConfigException; import org.onap.policy.common.endpoints.http.client.HttpClientFactory; import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance; -import org.onap.policy.common.endpoints.parameters.RestClientParameters; -import org.onap.policy.common.endpoints.report.HealthCheckReport; +import org.onap.policy.common.parameters.rest.RestClientParameters; +import org.onap.policy.common.utils.report.HealthCheckReport; import org.onap.policy.models.base.PfModelRuntimeException; import org.onap.policy.models.pdp.concepts.Pdp; import org.onap.policy.models.pdp.concepts.PdpGroup; @@ -162,7 +162,7 @@ public Pair> fetchPolicyComponentsHealthStatus() List groups = pdpGroupService.getPdpGroups(); Map> pdpListWithType = fetchPdpsHealthStatus(groups); if (isHealthy && (!verifyNumberOfPdps(groups) || pdpListWithType.values().stream().flatMap(List::stream) - .anyMatch(pdp -> !PdpHealthStatus.HEALTHY.equals(pdp.getHealthy())))) { + .anyMatch(pdp -> !PdpHealthStatus.HEALTHY.equals(pdp.getHealthy())))) { isHealthy = false; } result.put(PapConstants.POLICY_PDPS, pdpListWithType); @@ -219,13 +219,13 @@ private HealthCheckReport fetchPolicyComponentHealthStatus(HttpClient httpClient } catch (RuntimeException e) { LOGGER.warn("{} connection error", httpClient.getName()); clientReport = createHealthCheckReport(httpClient.getName(), httpClient.getBaseUrl(), - HttpURLConnection.HTTP_INTERNAL_ERROR, false, e.getMessage()); + HttpURLConnection.HTTP_INTERNAL_ERROR, false, e.getMessage()); } return clientReport; } private HealthCheckReport createHealthCheckReport(String name, String url, int code, boolean status, - String message) { + String message) { var report = new HealthCheckReport(); report.setName(name); report.setUrl(url); @@ -247,12 +247,12 @@ private HealthCheckReport replaceIpWithHostname(HealthCheckReport report, String private HealthCheckReport verifyKafkaClient(HttpClient httpClient, Response resp) { KafkaGetTopicResponse kafkaResponse = resp.readEntity(KafkaGetTopicResponse.class); var topicVerificationStatus = (kafkaResponse.getTopics() != null - && kafkaResponse.getTopics().contains(topicPolicyPdpPap)); + && kafkaResponse.getTopics().contains(topicPolicyPdpPap)); String message = (topicVerificationStatus ? "PAP to Kafka connection check is successful" - : "PAP to Kafka connection check failed"); + : "PAP to Kafka connection check failed"); int code = (topicVerificationStatus ? resp.getStatus() : 503); return createHealthCheckReport(httpClient.getName(), httpClient.getBaseUrl(), code, - topicVerificationStatus, message); + topicVerificationStatus, message); } } diff --git a/main/src/main/java/org/onap/policy/pap/main/rest/stub/HealthCheckRestControllerV1Stub.java b/main/src/main/java/org/onap/policy/pap/main/rest/stub/HealthCheckRestControllerV1Stub.java index 08bc645e8..d2ee07b38 100644 --- a/main/src/main/java/org/onap/policy/pap/main/rest/stub/HealthCheckRestControllerV1Stub.java +++ b/main/src/main/java/org/onap/policy/pap/main/rest/stub/HealthCheckRestControllerV1Stub.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2023 Nordix Foundation. + * 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. @@ -21,7 +21,7 @@ package org.onap.policy.pap.main.rest.stub; import lombok.RequiredArgsConstructor; -import org.onap.policy.common.endpoints.report.HealthCheckReport; +import org.onap.policy.common.utils.report.HealthCheckReport; import org.onap.policy.pap.main.rest.HealthCheckRestControllerV1Api; import org.onap.policy.pap.main.rest.PapRestControllerV1; import org.springframework.context.annotation.Profile; diff --git a/main/src/main/java/org/onap/policy/pap/main/startstop/PapActivator.java b/main/src/main/java/org/onap/policy/pap/main/startstop/PapActivator.java index 91fc21aae..7d5515593 100644 --- a/main/src/main/java/org/onap/policy/pap/main/startstop/PapActivator.java +++ b/main/src/main/java/org/onap/policy/pap/main/startstop/PapActivator.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2019, 2022-2023 Nordix Foundation. + * Copyright (C) 2019, 2022-2024 Nordix Foundation. * Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. * Modifications Copyright (C) 2021-2023 Bell Canada. All rights reserved. * ================================================================================ @@ -29,11 +29,11 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; import lombok.Getter; -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.TopicSource; import org.onap.policy.common.endpoints.listeners.MessageTypeDispatcher; import org.onap.policy.common.endpoints.listeners.RequestIdDispatcher; +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.TopicSource; import org.onap.policy.common.parameters.ParameterService; import org.onap.policy.common.utils.services.Registry; import org.onap.policy.common.utils.services.ServiceManagerContainer; diff --git a/main/src/test/java/org/onap/policy/pap/main/comm/CommonRequestBase.java b/main/src/test/java/org/onap/policy/pap/main/comm/CommonRequestBase.java index 81e0d5bce..921174251 100644 --- a/main/src/test/java/org/onap/policy/pap/main/comm/CommonRequestBase.java +++ b/main/src/test/java/org/onap/policy/pap/main/comm/CommonRequestBase.java @@ -3,7 +3,7 @@ * ONAP PAP * ================================================================================ * Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2021-2023 Nordix Foundation. + * Modifications Copyright (C) 2021-2024 Nordix Foundation. * Modifications Copyright (C) 2022 Bell Canada. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -37,9 +37,9 @@ import org.junit.jupiter.api.BeforeEach; import org.mockito.ArgumentCaptor; import org.mockito.stubbing.Answer; -import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure; import org.onap.policy.common.endpoints.listeners.RequestIdDispatcher; import org.onap.policy.common.endpoints.listeners.TypedMessageListener; +import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure; import org.onap.policy.common.utils.services.Registry; import org.onap.policy.models.pdp.concepts.PdpMessage; import org.onap.policy.models.pdp.concepts.PdpStateChange; diff --git a/main/src/test/java/org/onap/policy/pap/main/comm/MultiPdpStatusListenerTest.java b/main/src/test/java/org/onap/policy/pap/main/comm/MultiPdpStatusListenerTest.java index e3bf63bcf..af88c1cf9 100644 --- a/main/src/test/java/org/onap/policy/pap/main/comm/MultiPdpStatusListenerTest.java +++ b/main/src/test/java/org/onap/policy/pap/main/comm/MultiPdpStatusListenerTest.java @@ -3,7 +3,7 @@ * ONAP PAP * ================================================================================ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2021, 2023 Nordix Foundation. + * Modifications Copyright (C) 2021, 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. @@ -31,7 +31,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; 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.models.pdp.concepts.PdpResponseDetails; import org.onap.policy.models.pdp.concepts.PdpStatus; diff --git a/main/src/test/java/org/onap/policy/pap/main/comm/PdpHeartbeatListenerTest.java b/main/src/test/java/org/onap/policy/pap/main/comm/PdpHeartbeatListenerTest.java index 0f221f04b..86f96f126 100644 --- a/main/src/test/java/org/onap/policy/pap/main/comm/PdpHeartbeatListenerTest.java +++ b/main/src/test/java/org/onap/policy/pap/main/comm/PdpHeartbeatListenerTest.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2019-2021, 2023 Nordix Foundation. + * Copyright (C) 2019-2021, 2023-2024 Nordix Foundation. * Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. * Modifications Copyright (C) 2021-2023 Bell Canada. All rights reserved. * ================================================================================ @@ -31,7 +31,7 @@ import java.util.List; import java.util.stream.Collectors; 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.models.pdp.concepts.PdpGroup; import org.onap.policy.models.pdp.concepts.PdpStatus; import org.onap.policy.models.pdp.concepts.PdpSubGroup; diff --git a/main/src/test/java/org/onap/policy/pap/main/comm/PublisherTest.java b/main/src/test/java/org/onap/policy/pap/main/comm/PublisherTest.java index 4e83ef0ee..6189b0b5b 100644 --- a/main/src/test/java/org/onap/policy/pap/main/comm/PublisherTest.java +++ b/main/src/test/java/org/onap/policy/pap/main/comm/PublisherTest.java @@ -36,9 +36,9 @@ 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.TopicEndpointManager; -import org.onap.policy.common.endpoints.event.comm.TopicListener; +import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure; +import org.onap.policy.common.message.bus.event.TopicEndpointManager; +import org.onap.policy.common.message.bus.event.TopicListener; import org.onap.policy.common.utils.coder.Coder; import org.onap.policy.common.utils.coder.CoderException; import org.onap.policy.common.utils.coder.StandardCoder; diff --git a/main/src/test/java/org/onap/policy/pap/main/parameters/TestPapParameterGroup.java b/main/src/test/java/org/onap/policy/pap/main/parameters/TestPapParameterGroup.java index 7303537b3..8c807f201 100644 --- a/main/src/test/java/org/onap/policy/pap/main/parameters/TestPapParameterGroup.java +++ b/main/src/test/java/org/onap/policy/pap/main/parameters/TestPapParameterGroup.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2019, 2023 Nordix Foundation. + * Copyright (C) 2019, 2023-2024 Nordix Foundation. * Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property. * Modifications Copyright (C) 2021 Bell Canada. All rights reserved. * Modification Copyright 2022. Nordix Foundation. @@ -30,8 +30,8 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.Test; -import org.onap.policy.common.endpoints.parameters.TopicParameterGroup; import org.onap.policy.common.parameters.ValidationResult; +import org.onap.policy.common.parameters.topic.TopicParameterGroup; import org.onap.policy.common.utils.coder.Coder; import org.onap.policy.common.utils.coder.CoderException; import org.onap.policy.common.utils.coder.StandardCoder; diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/CommonPapRestServer.java b/main/src/test/java/org/onap/policy/pap/main/rest/CommonPapRestServer.java index f976d5979..e284705a5 100644 --- a/main/src/test/java/org/onap/policy/pap/main/rest/CommonPapRestServer.java +++ b/main/src/test/java/org/onap/policy/pap/main/rest/CommonPapRestServer.java @@ -45,10 +45,10 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; -import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager; import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance; import org.onap.policy.common.endpoints.http.server.YamlMessageBodyHandler; import org.onap.policy.common.gson.GsonMessageBodyHandler; +import org.onap.policy.common.message.bus.event.TopicEndpointManager; import org.onap.policy.common.utils.network.NetworkUtil; import org.onap.policy.common.utils.security.SelfSignedKeyStore; import org.onap.policy.common.utils.services.Registry; diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/TestHealthCheckRestControllerV1.java b/main/src/test/java/org/onap/policy/pap/main/rest/TestHealthCheckRestControllerV1.java index c1058a781..036421ae0 100644 --- a/main/src/test/java/org/onap/policy/pap/main/rest/TestHealthCheckRestControllerV1.java +++ b/main/src/test/java/org/onap/policy/pap/main/rest/TestHealthCheckRestControllerV1.java @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2019, 2022-2023 Nordix Foundation. + * Copyright (C) 2019, 2022-2024 Nordix Foundation. * Modifications Copyright (C) 2019 AT&T Intellectual Property. * Modifications Copyright (C) 2022 Bell Canada. All rights reserved. * ================================================================================ @@ -29,7 +29,7 @@ import jakarta.ws.rs.client.Invocation; import jakarta.ws.rs.client.SyncInvoker; import org.junit.jupiter.api.Test; -import org.onap.policy.common.endpoints.report.HealthCheckReport; +import org.onap.policy.common.utils.report.HealthCheckReport; import org.onap.policy.models.base.PfModelRuntimeException; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.test.context.ActiveProfiles; diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/TestPolicyComponentsHealthCheckControllerV1.java b/main/src/test/java/org/onap/policy/pap/main/rest/TestPolicyComponentsHealthCheckControllerV1.java index b09280712..a9d8a76a7 100644 --- a/main/src/test/java/org/onap/policy/pap/main/rest/TestPolicyComponentsHealthCheckControllerV1.java +++ b/main/src/test/java/org/onap/policy/pap/main/rest/TestPolicyComponentsHealthCheckControllerV1.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2019-2020, 2022-2023 Nordix Foundation. + * Copyright (C) 2019-2020, 2022-2024 Nordix Foundation. * Modifications Copyright (C) 2020-2021 AT&T Inc. * Modifications Copyright (C) 2021 Bell Canada. All rights reserved. * ================================================================================ @@ -32,7 +32,7 @@ import java.util.List; import java.util.Map; import org.junit.jupiter.api.Test; -import org.onap.policy.common.endpoints.parameters.RestClientParameters; +import org.onap.policy.common.parameters.rest.RestClientParameters; import org.onap.policy.pap.main.parameters.PapParameterGroup; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ActiveProfiles; diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/TestPolicyComponentsHealthCheckProvider.java b/main/src/test/java/org/onap/policy/pap/main/rest/TestPolicyComponentsHealthCheckProvider.java index 60712c064..ddb8f0de5 100644 --- a/main/src/test/java/org/onap/policy/pap/main/rest/TestPolicyComponentsHealthCheckProvider.java +++ b/main/src/test/java/org/onap/policy/pap/main/rest/TestPolicyComponentsHealthCheckProvider.java @@ -41,11 +41,11 @@ import org.mockito.MockitoAnnotations; import org.onap.policy.common.endpoints.http.client.HttpClient; import org.onap.policy.common.endpoints.http.client.HttpClientFactory; -import org.onap.policy.common.endpoints.report.HealthCheckReport; import org.onap.policy.common.parameters.ParameterService; import org.onap.policy.common.utils.coder.Coder; import org.onap.policy.common.utils.coder.CoderException; import org.onap.policy.common.utils.coder.StandardCoder; +import org.onap.policy.common.utils.report.HealthCheckReport; import org.onap.policy.common.utils.resources.ResourceUtils; import org.onap.policy.common.utils.services.Registry; import org.onap.policy.models.pdp.concepts.Pdp; diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/e2e/End2EndContext.java b/main/src/test/java/org/onap/policy/pap/main/rest/e2e/End2EndContext.java index c6a674830..55840bfea 100644 --- a/main/src/test/java/org/onap/policy/pap/main/rest/e2e/End2EndContext.java +++ b/main/src/test/java/org/onap/policy/pap/main/rest/e2e/End2EndContext.java @@ -33,12 +33,12 @@ import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.LinkedBlockingQueue; import lombok.Getter; -import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure; -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.bus.NoopTopicSource; import org.onap.policy.common.endpoints.listeners.MessageTypeDispatcher; import org.onap.policy.common.endpoints.listeners.ScoListener; +import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure; +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.noop.NoopTopicSource; import org.onap.policy.common.utils.coder.Coder; import org.onap.policy.common.utils.coder.CoderException; import org.onap.policy.common.utils.coder.StandardCoder; diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/e2e/HealthCheckTest.java b/main/src/test/java/org/onap/policy/pap/main/rest/e2e/HealthCheckTest.java index d1c89b212..206c29b8c 100644 --- a/main/src/test/java/org/onap/policy/pap/main/rest/e2e/HealthCheckTest.java +++ b/main/src/test/java/org/onap/policy/pap/main/rest/e2e/HealthCheckTest.java @@ -3,7 +3,7 @@ * ONAP PAP * ================================================================================ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2022-2023 Nordix Foundation. + * Modifications Copyright (C) 2022-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. @@ -27,7 +27,7 @@ import jakarta.ws.rs.client.Invocation; import java.net.HttpURLConnection; import org.junit.jupiter.api.Test; -import org.onap.policy.common.endpoints.report.HealthCheckReport; +import org.onap.policy.common.utils.report.HealthCheckReport; class HealthCheckTest extends End2EndBase { private static final String HEALTHCHECK_ENDPOINT = "healthcheck"; diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/e2e/PdpGroupDeleteTest.java b/main/src/test/java/org/onap/policy/pap/main/rest/e2e/PdpGroupDeleteTest.java index 647a60e81..66d061a68 100644 --- a/main/src/test/java/org/onap/policy/pap/main/rest/e2e/PdpGroupDeleteTest.java +++ b/main/src/test/java/org/onap/policy/pap/main/rest/e2e/PdpGroupDeleteTest.java @@ -3,7 +3,7 @@ * ONAP PAP * ================================================================================ * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2021-2023 Nordix Foundation. + * Modifications Copyright (C) 2021-2024 Nordix Foundation. * Modifications Copyright (C) 2021-2022 Bell Canada. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -35,8 +35,8 @@ import java.util.concurrent.TimeUnit; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.onap.policy.common.endpoints.event.comm.bus.NoopTopicFactories; -import org.onap.policy.common.endpoints.event.comm.bus.NoopTopicSink; +import org.onap.policy.common.message.bus.event.noop.NoopTopicFactories; +import org.onap.policy.common.message.bus.event.noop.NoopTopicSink; import org.onap.policy.common.utils.coder.StandardCoder; import org.onap.policy.models.pap.concepts.PdpGroupDeleteResponse; import org.onap.policy.models.pap.concepts.PdpGroupDeployResponse; diff --git a/main/src/test/java/org/onap/policy/pap/main/rest/e2e/PdpGroupDeployTest.java b/main/src/test/java/org/onap/policy/pap/main/rest/e2e/PdpGroupDeployTest.java index 7dbf5a0b8..6e2ca168a 100644 --- a/main/src/test/java/org/onap/policy/pap/main/rest/e2e/PdpGroupDeployTest.java +++ b/main/src/test/java/org/onap/policy/pap/main/rest/e2e/PdpGroupDeployTest.java @@ -37,8 +37,8 @@ import java.util.concurrent.TimeUnit; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.onap.policy.common.endpoints.event.comm.bus.NoopTopicFactories; -import org.onap.policy.common.endpoints.event.comm.bus.NoopTopicSink; +import org.onap.policy.common.message.bus.event.noop.NoopTopicFactories; +import org.onap.policy.common.message.bus.event.noop.NoopTopicSink; import org.onap.policy.common.utils.coder.StandardCoder; import org.onap.policy.models.pap.concepts.PdpDeployPolicies; import org.onap.policy.models.pap.concepts.PdpGroupDeployResponse; diff --git a/main/src/test/java/org/onap/policy/pap/main/startstop/TestPapActivator.java b/main/src/test/java/org/onap/policy/pap/main/startstop/TestPapActivator.java index a49f3c588..c740d6952 100644 --- a/main/src/test/java/org/onap/policy/pap/main/startstop/TestPapActivator.java +++ b/main/src/test/java/org/onap/policy/pap/main/startstop/TestPapActivator.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2019, 2022-2023 Nordix Foundation. + * Copyright (C) 2019, 2022-2024 Nordix Foundation. * Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property. * Modifications Copyright (C) 2021-2023 Bell Canada. All rights reserved. * ================================================================================ @@ -38,8 +38,8 @@ 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.TopicEndpointManager; import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance; +import org.onap.policy.common.message.bus.event.TopicEndpointManager; import org.onap.policy.common.utils.network.NetworkUtil; import org.onap.policy.common.utils.services.Registry; import org.onap.policy.pap.main.PapConstants;