Moving message bus configurations to its own module 16/139316/1
authoradheli.tavares <adheli.tavares@est.tech>
Mon, 23 Sep 2024 14:13:36 +0000 (15:13 +0100)
committeradheli.tavares <adheli.tavares@est.tech>
Fri, 1 Nov 2024 10:36:08 +0000 (10:36 +0000)
Issue-ID: POLICY-5131
Change-Id: Ibbcdc487300767e7b10d69e9b388c50f09e1adbc
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
149 files changed:
common-parameters/pom.xml
common-parameters/src/main/java/org/onap/policy/common/parameters/ParameterGroup.java
common-parameters/src/main/java/org/onap/policy/common/parameters/ValidationResult.java
common-parameters/src/main/java/org/onap/policy/common/parameters/rest/RestClientParameters.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/parameters/RestClientParameters.java with 92% similarity]
common-parameters/src/main/java/org/onap/policy/common/parameters/rest/RestServerParameters.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/parameters/RestServerParameters.java with 95% similarity]
common-parameters/src/main/java/org/onap/policy/common/parameters/topic/BusTopicParams.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusTopicParams.java with 96% similarity]
common-parameters/src/main/java/org/onap/policy/common/parameters/topic/TopicParameterGroup.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/parameters/TopicParameterGroup.java with 98% similarity]
common-parameters/src/main/java/org/onap/policy/common/parameters/topic/TopicParameters.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/parameters/TopicParameters.java with 89% similarity]
common-parameters/src/test/java/org/onap/policy/common/parameters/TestBeanValidationResult.java
common-parameters/src/test/java/org/onap/policy/common/parameters/TestBeanValidator.java
common-parameters/src/test/java/org/onap/policy/common/parameters/TestFieldValidator.java
common-parameters/src/test/java/org/onap/policy/common/parameters/rest/RestClientParametersTest.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/parameters/RestClientParametersTest.java with 98% similarity]
common-parameters/src/test/java/org/onap/policy/common/parameters/topic/BusTopicParamsTest.java [new file with mode: 0644]
gson/pom.xml
gson/src/test/java/org/onap/policy/common/gson/internal/ClassWalkerTest.java
message-bus/pom.xml [new file with mode: 0644]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/Topic.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/Topic.java with 96% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/TopicEndpoint.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/TopicEndpoint.java with 94% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/TopicEndpointManager.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/TopicEndpointManager.java with 87% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/TopicEndpointProxy.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/TopicEndpointProxy.java with 95% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/TopicListener.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/TopicListener.java with 76% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/TopicRegisterable.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/TopicRegisterable.java with 80% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/TopicSink.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/TopicSink.java with 81% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/TopicSource.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/TopicSource.java with 81% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/base/ApiKeyEnabled.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/ApiKeyEnabled.java with 80% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/base/BusConsumer.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusConsumer.java with 92% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/base/BusPublisher.java [new file with mode: 0644]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/base/BusTopicBase.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusTopicBase.java with 83% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/base/BusTopicSink.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/BusTopicSink.java with 86% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/base/BusTopicSource.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/BusTopicSource.java with 87% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/base/InlineBusTopicSink.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/InlineBusTopicSink.java with 84% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/base/SingleThreadedBusTopicSource.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/SingleThreadedBusTopicSource.java with 90% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/base/TopicBase.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/TopicBase.java with 96% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/base/TopicBaseFactory.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/TopicBaseFactory.java with 90% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/base/TopicBaseHashedFactory.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/TopicBaseHashedFactory.java with 95% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/client/BidirectionalTopicClient.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/client/BidirectionalTopicClient.java with 93% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/client/BidirectionalTopicClientException.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/client/BidirectionalTopicClientException.java with 93% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/client/TopicSinkClient.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/client/TopicSinkClient.java with 94% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/client/TopicSinkClientException.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/client/TopicSinkClientException.java with 93% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/kafka/IndexedKafkaTopicSinkFactory.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/IndexedKafkaTopicSinkFactory.java with 85% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/kafka/IndexedKafkaTopicSourceFactory.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/IndexedKafkaTopicSourceFactory.java with 75% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/kafka/InlineKafkaTopicSink.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/InlineKafkaTopicSink.java with 88% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/kafka/KafkaPublisherWrapper.java [new file with mode: 0644]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/kafka/KafkaTopicFactories.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/KafkaTopicFactories.java with 92% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/kafka/KafkaTopicSink.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/KafkaTopicSink.java with 84% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/kafka/KafkaTopicSinkFactory.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/KafkaTopicSinkFactory.java with 93% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/kafka/KafkaTopicSource.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/KafkaTopicSource.java with 83% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/kafka/KafkaTopicSourceFactory.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/KafkaTopicSourceFactory.java with 93% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/kafka/SingleThreadedKafkaTopicSource.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/SingleThreadedKafkaTopicSource.java with 86% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/noop/NoopTopicEndpoint.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/NoopTopicEndpoint.java with 89% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/noop/NoopTopicFactories.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/NoopTopicFactories.java with 93% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/noop/NoopTopicFactory.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/NoopTopicFactory.java with 83% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/noop/NoopTopicSink.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/NoopTopicSink.java with 86% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/noop/NoopTopicSinkFactory.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/NoopTopicSinkFactory.java with 81% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/noop/NoopTopicSource.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/NoopTopicSource.java with 86% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/event/noop/NoopTopicSourceFactory.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/NoopTopicSourceFactory.java with 81% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/features/NetLoggerFeatureApi.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/features/NetLoggerFeatureApi.java with 86% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/features/NetLoggerFeatureProviders.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/features/NetLoggerFeatureProviders.java with 93% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/properties/MessageBusProperties.java [new file with mode: 0644]
message-bus/src/main/java/org/onap/policy/common/message/bus/utils/KafkaPropertyUtils.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/utils/KafkaPropertyUtils.java with 80% similarity]
message-bus/src/main/java/org/onap/policy/common/message/bus/utils/NetLoggerUtil.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/utils/NetLoggerUtil.java with 94% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/event/CommonTestData.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/parameters/CommonTestData.java with 69% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/event/TopicEndpointProxyTest.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/TopicEndpointProxyTest.java with 92% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/event/TopicParameterGroupTest.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/parameters/TopicParameterGroupTest.java with 89% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/event/base/BusConsumerTest.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusConsumerTest.java with 91% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/event/base/BusTopicBaseTest.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusTopicBaseTest.java with 94% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/event/base/BusTopicFactoryTestBase.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/BusTopicFactoryTestBase.java with 86% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/event/base/InlineBusTopicSinkTest.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/internal/InlineBusTopicSinkTest.java with 94% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/event/base/SingleThreadedBusTopicSourceTest.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/internal/SingleThreadedBusTopicSourceTest.java with 97% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/event/base/TopicBaseTest.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/internal/TopicBaseTest.java with 94% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/event/base/TopicFactoryTestBase.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/TopicFactoryTestBase.java with 90% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/event/base/TopicPropertyBuilder.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/TopicPropertyBuilder.java with 97% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/event/base/TopicTestBase.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/TopicTestBase.java with 92% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/event/client/BidirectionalTopicClientTest.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/client/BidirectionalTopicClientTest.java with 93% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/event/client/TopicClientExceptionTest.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/client/TopicClientExceptionTest.java with 96% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/event/client/TopicSinkClientTest.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/client/TopicSinkClientTest.java with 92% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/event/kafka/IndexedKafkaTopicSourceFactoryTest.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/IndexedKafkaTopicSourceFactoryTest.java with 83% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/event/kafka/InlineKafkaTopicSinkTest.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/internal/InlineKafkaTopicSinkTest.java with 86% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/event/kafka/KafkaPublisherWrapperTest.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/internal/KafkaPublisherWrapperTest.java with 90% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/event/kafka/KafkaTopicFactoryTestBase.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/KafkaTopicFactoryTestBase.java with 86% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/event/kafka/KafkaTopicPropertyBuilder.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/KafkaTopicPropertyBuilder.java with 76% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/event/kafka/KafkaTopicSinkFactoryTest.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/KafkaTopicSinkFactoryTest.java with 89% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/event/kafka/KafkaTopicSinkTest.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/KafkaTopicSinkTest.java with 95% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/event/kafka/KafkaTopicSourceFactoryTest.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/KafkaTopicSourceFactoryTest.java with 89% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/event/kafka/KafkaTopicSourceTest.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/KafkaTopicSourceTest.java with 95% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/event/kafka/SingleThreadedKafkaTopicSourceTest.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/internal/SingleThreadedKafkaTopicSourceTest.java with 75% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/event/noop/NoopTopicEndpointTest.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/NoopTopicEndpointTest.java with 93% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/event/noop/NoopTopicFactoryTest.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/NoopTopicFactoryTest.java with 88% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/event/noop/NoopTopicPropertyBuilder.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/NoopTopicPropertyBuilder.java with 67% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/event/noop/NoopTopicSinkFactoryTest.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/NoopTopicSinkFactoryTest.java with 96% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/event/noop/NoopTopicSinkTest.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/NoopTopicSinkTest.java with 97% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/event/noop/NoopTopicSourceFactoryTest.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/NoopTopicSourceFactoryTest.java with 96% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/event/noop/NoopTopicSourceTest.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/NoopTopicSourceTest.java with 92% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/features/NetLoggerFeatureApiTest.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/features/NetLoggerFeatureApiTest.java with 93% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/utils/KafkaPropertyUtilsTest.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/utils/KafkaPropertyUtilsTest.java with 89% similarity]
message-bus/src/test/java/org/onap/policy/common/message/bus/utils/NetLoggerUtilTest.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/utils/NetLoggerUtilTest.java with 93% similarity]
message-bus/src/test/resources/META-INF/services/org.onap.policy.common.message.bus.features.NetLoggerFeatureApi [new file with mode: 0644]
message-bus/src/test/resources/logback-test.xml [new file with mode: 0644]
message-bus/src/test/resources/org/onap/policy/common/message/bus/event/TopicEndpointProxyTest.json [moved from policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/TopicEndpointProxyTest.json with 100% similarity]
message-bus/src/test/resources/org/onap/policy/common/message/bus/event/base/BusTopicBaseTest.json [moved from policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/BusTopicBaseTest.json with 100% similarity]
message-bus/src/test/resources/org/onap/policy/common/message/bus/event/base/InlineBusTopicSinkTest.json [moved from policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/InlineBusTopicSinkTest.json with 100% similarity]
message-bus/src/test/resources/org/onap/policy/common/message/bus/event/base/SingleThreadedBusTopicSourceTest.json [moved from policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/SingleThreadedBusTopicSourceTest.json with 100% similarity]
message-bus/src/test/resources/org/onap/policy/common/message/bus/event/base/TopicBaseTest.json [moved from policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/TopicBaseTest.json with 100% similarity]
message-bus/src/test/resources/org/onap/policy/common/message/bus/parameters/TopicParameters_all_params.json [moved from policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/parameters/TopicParameters_all_params.json with 100% similarity]
message-bus/src/test/resources/org/onap/policy/common/message/bus/parameters/TopicParameters_invalid.json [moved from policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/parameters/TopicParameters_invalid.json with 100% similarity]
message-bus/src/test/resources/org/onap/policy/common/message/bus/parameters/TopicParameters_missing_mandatory.json [moved from policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/parameters/TopicParameters_missing_mandatory.json with 100% similarity]
message-bus/src/test/resources/org/onap/policy/common/message/bus/parameters/TopicParameters_valid.json [moved from policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/parameters/TopicParameters_valid.json with 100% similarity]
policy-endpoints/pom.xml
policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusPublisher.java [deleted file]
policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/client/HttpClientFactory.java
policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/client/IndexedHttpClientFactory.java
policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/client/internal/JerseyClient.java
policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/IndexedHttpServletServerFactory.java
policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/RestServer.java
policy-endpoints/src/main/java/org/onap/policy/common/endpoints/listeners/JsonListener.java
policy-endpoints/src/main/java/org/onap/policy/common/endpoints/listeners/MessageTypeDispatcher.java
policy-endpoints/src/main/java/org/onap/policy/common/endpoints/listeners/RequestIdDispatcher.java
policy-endpoints/src/main/java/org/onap/policy/common/endpoints/listeners/ScoListener.java
policy-endpoints/src/main/java/org/onap/policy/common/endpoints/listeners/TypedMessageListener.java
policy-endpoints/src/main/java/org/onap/policy/common/endpoints/properties/PolicyEndPointProperties.java
policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusTopicParamsTest.java [deleted file]
policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/HttpClientTest.java
policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/HttpServerTest.java
policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/RestServerTest.java
policy-endpoints/src/test/java/org/onap/policy/common/endpoints/listeners/JsonListenerTest.java
policy-endpoints/src/test/java/org/onap/policy/common/endpoints/listeners/MessageTypeDispatcherTest.java
policy-endpoints/src/test/java/org/onap/policy/common/endpoints/listeners/RequestIdDispatcherTest.java
policy-endpoints/src/test/java/org/onap/policy/common/endpoints/listeners/ScoListenerTest.java
policy-endpoints/src/test/java/org/onap/policy/common/endpoints/rest/CommonTestData.java [new file with mode: 0644]
policy-endpoints/src/test/java/org/onap/policy/common/endpoints/rest/RestServerParametersTest.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/parameters/RestServerParametersTest.java with 93% similarity]
policy-endpoints/src/test/resources/META-INF/services/org.onap.policy.common.endpoints.features.NetLoggerFeatureApi [deleted file]
policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/InlineKafkaTopicSinkTest.json [deleted file]
policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/SingleThreadedKafkaTopicSourceTest.json [deleted file]
policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/rest/RestServerParameters_invalid.json [moved from policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/parameters/RestServerParameters_invalid.json with 100% similarity]
policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/rest/RestServerParameters_valid.json [moved from policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/parameters/RestServerParameters_valid.json with 100% similarity]
policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/rest/TopicParameters_all_params.json [new file with mode: 0644]
policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/rest/TopicParameters_invalid.json [new file with mode: 0644]
policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/rest/TopicParameters_missing_mandatory.json [new file with mode: 0644]
policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/rest/TopicParameters_valid.json [new file with mode: 0644]
pom.xml
spring-utils/pom.xml
utils-test/pom.xml
utils/pom.xml
utils/src/main/java/org/onap/policy/common/utils/properties/PropertyUtils.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/utils/PropertyUtils.java with 98% similarity]
utils/src/main/java/org/onap/policy/common/utils/report/HealthCheckReport.java [moved from policy-endpoints/src/main/java/org/onap/policy/common/endpoints/report/HealthCheckReport.java with 89% similarity]
utils/src/main/java/org/onap/policy/common/utils/services/OrderedServiceImpl.java
utils/src/test/java/org/onap/policy/common/utils/properties/PropertyUtilsTest.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/utils/PropertyUtilsTest.java with 98% similarity]
utils/src/test/java/org/onap/policy/common/utils/report/TestHealthCheckReport.java [moved from policy-endpoints/src/test/java/org/onap/policy/common/endpoints/report/TestHealthCheckReport.java with 67% similarity]
utils/src/test/java/org/onap/policy/common/utils/resources/ResourceUtilsTest.java

index 3257d3b..5c112a9 100644 (file)
@@ -19,7 +19,8 @@
   SPDX-License-Identifier: Apache-2.0
   ============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.common</groupId>
 
     <artifactId>common-parameters</artifactId>
     <name>${project.artifactId}</name>
-    <description>[${project.parent.artifactId}] module provides common property and parameter handling the ONAP Policy Framework</description>
+    <description>[${project.parent.artifactId}] module provides common property and parameter handling the ONAP Policy
+        Framework
+    </description>
 
     <dependencies>
         <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-            <scope>provided</scope>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.projectlombok</groupId>
-            <artifactId>lombok</artifactId>
+            <groupId>com.google.re2j</groupId>
+            <artifactId>re2j</artifactId>
         </dependency>
         <dependency>
             <groupId>jakarta.validation</groupId>
             <artifactId>commons-lang3</artifactId>
         </dependency>
         <dependency>
-            <groupId>com.google.re2j</groupId>
-            <artifactId>re2j</artifactId>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
         </dependency>
         <dependency>
-            <groupId>com.google.code.gson</groupId>
-            <artifactId>gson</artifactId>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.assertj</groupId>
-            <artifactId>assertj-core</artifactId>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-core</artifactId>
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.mockito</groupId>
-            <artifactId>mockito-core</artifactId>
+            <groupId>org.assertj</groupId>
+            <artifactId>assertj-core</artifactId>
+            <scope>test</scope>
         </dependency>
     </dependencies>
 </project>
index ab61093..c26b7b4 100644 (file)
@@ -1,8 +1,9 @@
 /*-
- * ============LICENSE_START=======================================================
+ * ============LICENSE_START=========================================================
  *  Copyright (C) 2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 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.
  * You may obtain a copy of the License at
@@ -33,14 +34,14 @@ public interface ParameterGroup {
      *
      * @return the group name
      */
-    public String getName();
+    String getName();
 
     /**
      * Set the group name.
      *
      * @param name the group name
      */
-    public void setName(final String name);
+    void setName(final String name);
 
     /**
      * Validate parameters.
index 309fd00..e601741 100644 (file)
@@ -1,19 +1,20 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2018 Ericsson. 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.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
+ *
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
@@ -29,14 +30,14 @@ public interface ValidationResult {
      *
      * @return the name
      */
-    public String getName();
+    String getName();
 
     /**
      * Gets the status of validation.
      *
      * @return the status
      */
-    public ValidationStatus getStatus();
+    ValidationStatus getStatus();
 
     /**
      * Checks if the result is valid.
@@ -44,7 +45,7 @@ public interface ValidationResult {
      * @return true, if is valid
      */
     default boolean isValid() {
-        return getStatus().isValid(); 
+        return getStatus().isValid();
     }
 
     /**
@@ -53,7 +54,7 @@ public interface ValidationResult {
      * @return true, if is clean
      */
     default boolean isClean() {
-        return getStatus().isClean(); 
+        return getStatus().isClean();
     }
 
     /**
@@ -63,25 +64,26 @@ public interface ValidationResult {
      */
     default String getResult() {
         return getResult(
-                        ParameterConstants.DEFAULT_INITIAL_RESULT_INDENTATION,
-                        ParameterConstants.DEFAULT_RESULT_INDENTATION,
-                        ParameterConstants.DO_NOT_SHOW_CLEAN_RESULTS);
+            ParameterConstants.DEFAULT_INITIAL_RESULT_INDENTATION,
+            ParameterConstants.DEFAULT_RESULT_INDENTATION,
+            ParameterConstants.DO_NOT_SHOW_CLEAN_RESULTS);
     }
 
     /**
      * Gets the validation result.
      *
      * @param initialIndentation the indentation to use on the main result output
-     * @param subIndentation the indentation to use on sub parts of the result output
-     * @param showClean output information on clean fields
+     * @param subIndentation     the indentation to use on sub parts of the result output
+     * @param showClean          output information on clean fields
      * @return the result
      */
-    public String getResult(final String initialIndentation, final String subIndentation, final boolean showClean);
-    
+    String getResult(final String initialIndentation, final String subIndentation, final boolean showClean);
+
     /**
-     * Set a validation result. 
-     * @param status The validation status the field is receiving
+     * Set a validation result.
+     *
+     * @param status  The validation status the field is receiving
      * @param message The validation message explaining the validation status
      */
-    public void setResult(final ValidationStatus status, final String message);
+    void setResult(final ValidationStatus status, final String message);
 }
\ No newline at end of file
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2021 Nordix Foundation.
+ *  Copyright (C) 2021, 2024 Nordix Foundation.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.parameters;
+package org.onap.policy.common.parameters.rest;
 
-import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
 import org.onap.policy.common.parameters.BeanValidationResult;
 import org.onap.policy.common.parameters.ParameterGroup;
 import org.onap.policy.common.parameters.ValidationStatus;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
 
 public class RestClientParameters extends BusTopicParams implements ParameterGroup {
 
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019,2023 Nordix Foundation.
+ *  Copyright (C) 2019, 2023-2024 Nordix Foundation.
  *  Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
  *  Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
  * ================================================================================
@@ -20,7 +20,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.parameters;
+package org.onap.policy.common.parameters.rest;
 
 import lombok.Getter;
 import org.onap.policy.common.parameters.ParameterGroupImpl;
@@ -20,7 +20,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus.internal;
+package org.onap.policy.common.parameters.topic;
 
 import java.util.List;
 import java.util.Map;
@@ -109,11 +109,11 @@ public class BusTopicParams {
         return StringUtils.isBlank(longitude);
     }
 
-    boolean isConsumerInstanceInvalid() {
+    public boolean isConsumerInstanceInvalid() {
         return StringUtils.isBlank(consumerInstance);
     }
 
-    boolean isConsumerGroupInvalid() {
+    public boolean isConsumerGroupInvalid() {
         return StringUtils.isBlank(consumerGroup);
     }
 
@@ -127,14 +127,14 @@ public class BusTopicParams {
 
     boolean isServersInvalid() {
         return (servers == null || servers.isEmpty()
-                || (servers.size() == 1 && ("".equals(servers.get(0)))));
+            || (servers.size() == 1 && ("".equals(servers.get(0)))));
     }
 
-    boolean isTopicInvalid() {
+    public boolean isTopicInvalid() {
         return StringUtils.isBlank(topic);
     }
 
-    boolean isPartitionIdInvalid() {
+    public boolean isPartitionIdInvalid() {
         return StringUtils.isBlank(partitionId);
     }
 
@@ -143,7 +143,7 @@ public class BusTopicParams {
     }
 
     public boolean isPortInvalid() {
-        return  (getPort() <= 0 || getPort() >= 65535);
+        return (getPort() <= 0 || getPort() >= 65535);
     }
 
     /**
@@ -166,7 +166,7 @@ public class BusTopicParams {
         return StringUtils.isNotBlank(password);
     }
 
-    boolean isAdditionalPropsValid() {
+    public boolean isAdditionalPropsValid() {
         return additionalProps != null;
     }
 
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
+ *  Copyright (C) 2019, 2024 Nordix Foundation.
  *  Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.parameters;
+package org.onap.policy.common.parameters.topic;
 
 import lombok.EqualsAndHashCode;
 import lombok.Getter;
 import lombok.Setter;
-import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
 import org.onap.policy.common.parameters.annotations.NotBlank;
 import org.onap.policy.common.parameters.annotations.NotNull;
 
index 2fc0994..ab733ae 100644 (file)
@@ -112,7 +112,7 @@ class TestBeanValidationResult {
 
     @Test
     void testValidateNotNullList() {
-        List<ValidationResult> list = Arrays.asList(clean);
+        List<ValidationResult> list = List.of(clean);
         assertTrue(bean.validateNotNullList(MY_LIST, list, item -> item));
         assertTrue(bean.isValid());
         assertNull(bean.getResult());
@@ -141,7 +141,7 @@ class TestBeanValidationResult {
         assertTrue(bean.isValid());
         assertNull(bean.getResult());
 
-        list = Arrays.asList(clean);
+        list = List.of(clean);
         bean = new BeanValidationResult(NAME, OBJECT);
         assertTrue(bean.validateList(MY_LIST, list, item -> item));
         assertTrue(bean.isValid());
index 31c3420..c421113 100644 (file)
@@ -82,9 +82,6 @@ class TestBeanValidator {
         data.strValue = STRING_VALUE;
         assertTrue(validator.validateTop(TOP, data).isValid());
 
-        /**
-         * Repeat with a subclass.
-         */
         @Getter
         class Derived extends Data {
             @Min(10)
@@ -119,8 +116,8 @@ class TestBeanValidator {
 
     @Test
     void testVerNotNull() {
+        @Getter
         class NotNullCheck {
-            @Getter
             @Min(1)
             @NotNull
             Integer intValue;
@@ -138,8 +135,8 @@ class TestBeanValidator {
 
     @Test
     void testVerNotBlank() {
+        @Getter
         class NotBlankCheck {
-            @Getter
             @NotBlank
             String strValue;
         }
@@ -164,8 +161,8 @@ class TestBeanValidator {
         /*
          * Class with "blank" annotation on an integer.
          */
+        @Getter
         class NotBlankInt {
-            @Getter
             @NotBlank
             int intValue;
         }
@@ -180,8 +177,8 @@ class TestBeanValidator {
      */
     @Test
     void testVerSizeCollection() {
+        @Getter
         class CollectionSizeCheck {
-            @Getter
             @Size(min = 3)
             Collection<Integer> items;
         }
@@ -210,8 +207,8 @@ class TestBeanValidator {
      */
     @Test
     void testVerSizeMap() {
+        @Getter
         class MapSizeCheck {
-            @Getter
             @Size(min = 3)
             Map<Integer, Integer> items;
         }
@@ -240,8 +237,8 @@ class TestBeanValidator {
      */
     @Test
     void testVerSizeOther() {
+        @Getter
         class OtherSizeCheck {
-            @Getter
             @Size(min = 3)
             Integer items;
         }
@@ -254,8 +251,8 @@ class TestBeanValidator {
 
     @Test
     void testVerRegex() {
+        @Getter
         class RegexCheck {
-            @Getter
             @Pattern(regexp = "[a-f]*")
             String strValue;
         }
@@ -272,8 +269,8 @@ class TestBeanValidator {
         assertTrue(validator.validateTop(TOP, regexCheck).isValid());
 
         // invalid regex
+        @Getter
         class InvalidRegexCheck {
-            @Getter
             @Pattern(regexp = "[a-f")
             String strValue;
         }
@@ -292,8 +289,8 @@ class TestBeanValidator {
         /*
          * Class with "regex" annotation on an integer.
          */
+        @Getter
         class RegexInt {
-            @Getter
             @Pattern(regexp = "[a-f]*")
             int intValue;
         }
@@ -309,8 +306,8 @@ class TestBeanValidator {
         /*
          * Field is not a number.
          */
+        @Getter
         class NonNumeric {
-            @Getter
             @Max(100)
             String strValue;
         }
@@ -322,68 +319,68 @@ class TestBeanValidator {
         /*
          * Integer field.
          */
+        @Getter
         class IntField {
-            @Getter
             @Max(100)
             Integer intValue;
         }
 
         // ok value
         IntField intField = new IntField();
-        assertNumeric("testVerMax-integer", intField, value -> {
+        assertNumeric(intField, value -> {
             intField.intValue = value;
-        }, INT_FIELD, "maximum", INT_VALUE, 100, 101);
+        }, INT_FIELD, "maximum", 100, 101);
 
         /*
          * Long field.
          */
+        @Getter
         class LongField {
-            @Getter
             @Max(100)
             Long numValue;
         }
 
         // ok value
         LongField longField = new LongField();
-        assertNumeric("testVerMax-long", longField, value -> {
+        assertNumeric(longField, value -> {
             longField.numValue = (long) value;
-        }, NUM_FIELD, "maximum", INT_VALUE, 100, 101);
+        }, NUM_FIELD, "maximum", 100, 101);
 
         /*
          * Float field.
          */
+        @Getter
         class FloatField {
-            @Getter
             @Max(100)
             Float numValue;
         }
 
         // ok value
         FloatField floatField = new FloatField();
-        assertNumeric("testVerMax-float", floatField, value -> {
+        assertNumeric(floatField, value -> {
             floatField.numValue = (float) value;
-        }, NUM_FIELD, "maximum", INT_VALUE, 100, 101);
+        }, NUM_FIELD, "maximum", 100, 101);
 
         /*
          * Double field.
          */
+        @Getter
         class DoubleField {
-            @Getter
             @Max(100)
             Double numValue;
         }
 
         // ok value
         DoubleField doubleField = new DoubleField();
-        assertNumeric("testVerMax-double", doubleField, value -> {
+        assertNumeric(doubleField, value -> {
             doubleField.numValue = (double) value;
-        }, NUM_FIELD, "maximum", INT_VALUE, 100, 101);
+        }, NUM_FIELD, "maximum", 100, 101);
 
         /*
          * Atomic Integer field (which is a subclass of Number).
          */
+        @Getter
         class AtomIntValue {
-            @Getter
             @Max(100)
             AtomicInteger numValue;
         }
@@ -403,8 +400,8 @@ class TestBeanValidator {
         /*
          * Field is not a number.
          */
+        @Getter
         class NonNumeric {
-            @Getter
             @Min(10)
             String strValue;
         }
@@ -416,68 +413,68 @@ class TestBeanValidator {
         /*
          * Integer field.
          */
+        @Getter
         class IntField {
-            @Getter
             @Min(10)
             Integer intValue;
         }
 
         // ok value
         IntField intField = new IntField();
-        assertNumeric("testVerMin-integer", intField, value -> {
+        assertNumeric(intField, value -> {
             intField.intValue = value;
-        }, INT_FIELD, "minimum", INT_VALUE, 10, 1);
+        }, INT_FIELD, "minimum", 10, 1);
 
         /*
          * Long field.
          */
+        @Getter
         class LongField {
-            @Getter
             @Min(10)
             Long numValue;
         }
 
         // ok value
         LongField longField = new LongField();
-        assertNumeric("testVerMin-long", longField, value -> {
+        assertNumeric(longField, value -> {
             longField.numValue = (long) value;
-        }, NUM_FIELD, "minimum", INT_VALUE, 10, 1);
+        }, NUM_FIELD, "minimum", 10, 1);
 
         /*
          * Float field.
          */
+        @Getter
         class FloatField {
-            @Getter
             @Min(10)
             Float numValue;
         }
 
         // ok value
         FloatField floatField = new FloatField();
-        assertNumeric("testVerMin-float", floatField, value -> {
+        assertNumeric(floatField, value -> {
             floatField.numValue = (float) value;
-        }, NUM_FIELD, "minimum", INT_VALUE, 10, 1);
+        }, NUM_FIELD, "minimum", 10, 1);
 
         /*
          * Double field.
          */
+        @Getter
         class DoubleField {
-            @Getter
             @Min(10)
             Double numValue;
         }
 
         // ok value
         DoubleField doubleField = new DoubleField();
-        assertNumeric("testVerMin-double", doubleField, value -> {
+        assertNumeric(doubleField, value -> {
             doubleField.numValue = (double) value;
-        }, NUM_FIELD, "minimum", INT_VALUE, 10, 1);
+        }, NUM_FIELD, "minimum", 10, 1);
 
         /*
          * Atomic Integer field (which is a subclass of Number).
          */
+        @Getter
         class AtomIntValue {
-            @Getter
             @Min(10)
             AtomicInteger numValue;
         }
@@ -494,8 +491,8 @@ class TestBeanValidator {
 
     @Test
     void testVerClassName() {
+        @Getter
         class ClassNameCheck {
-            @Getter
             @ClassName
             String strValue;
         }
@@ -518,8 +515,8 @@ class TestBeanValidator {
 
     @Test
     void testVerCascade() {
+        @Getter
         class Item {
-            @Getter
             @NotNull
             Integer intValue;
         }
@@ -626,27 +623,26 @@ class TestBeanValidator {
 
     @Test
     void testGetEntryName() {
-        assertThat(validator.getEntryName(makeEntry(null, 0))).isEmpty();
-        assertThat(validator.getEntryName(makeEntry("", 0))).isEmpty();
-        assertThat(validator.getEntryName(makeEntry(STRING_VALUE, 0))).isEqualTo(STRING_VALUE);
+        assertThat(validator.getEntryName(makeEntry(null))).isEmpty();
+        assertThat(validator.getEntryName(makeEntry(""))).isEmpty();
+        assertThat(validator.getEntryName(makeEntry(STRING_VALUE))).isEqualTo(STRING_VALUE);
     }
 
     /**
      * Makes a Map entry with the given key and value.
      *
      * @param key desired key
-     * @param value desired value
      * @return a new Map entry
      */
-    private Map.Entry<String, Integer> makeEntry(String key, int value) {
+    private Map.Entry<String, Integer> makeEntry(String key) {
         HashMap<String, Integer> map = new HashMap<>();
-        map.put(key, value);
+        map.put(key, 0);
         return map.entrySet().iterator().next();
     }
 
-    private <T> void assertNumeric(String testName, T object, Consumer<Integer> setter, String fieldName,
-                    String expectedText, int inside, int edge, int outside) {
-        setter.accept(inside);
+    private <T> void assertNumeric(T object, Consumer<Integer> setter, String fieldName,
+                                   String expectedText, int edge, int outside) {
+        setter.accept(TestBeanValidator.INT_VALUE);
         assertTrue(validator.validateTop(TOP, object).isValid());
 
         // on the edge
index 0fb39b0..0659ad8 100644 (file)
@@ -101,7 +101,7 @@ class TestFieldValidator extends ValidatorUtil {
     private int voidMethod;
 
     /**
-     * Accessor is {@link #getParameterizedMethod()}, which requires a parameter.
+     * Accessor is {@link #getParameterizedMethod(boolean)}, which requires a parameter.
      */
     @Min(0)
     private int parameterizedMethod;
@@ -357,7 +357,7 @@ class TestFieldValidator extends ValidatorUtil {
     }
 
     public int getParameterizedMethod(boolean flag) {
-        return 0;
+        return flag ? 0 : 1;
     }
 
     public int getExMethod() {
@@ -16,7 +16,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.parameters;
+package org.onap.policy.common.parameters.rest;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNull;
diff --git a/common-parameters/src/test/java/org/onap/policy/common/parameters/topic/BusTopicParamsTest.java b/common-parameters/src/test/java/org/onap/policy/common/parameters/topic/BusTopicParamsTest.java
new file mode 100644 (file)
index 0000000..c474e5f
--- /dev/null
@@ -0,0 +1,201 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2018-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.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.common.parameters.topic;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+import java.util.function.BiConsumer;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.onap.policy.common.parameters.topic.BusTopicParams.TopicParamsBuilder;
+
+class BusTopicParamsTest {
+
+    public static final String MY_AFT_ENV = "my-aft-env";
+    public static final String MY_API_KEY = "my-api-key";
+    public static final String MY_API_SECRET = "my-api-secret";
+    public static final String MY_BASE_PATH = "my-base";
+    public static final String MY_CLIENT_NAME = "my-client";
+    public static final String MY_CONS_GROUP = "my-cons-group";
+    public static final String MY_CONS_INST = "my-cons-inst";
+    public static final String MY_ENV = "my-env";
+    public static final int MY_FETCH_LIMIT = 100;
+    public static final int MY_FETCH_TIMEOUT = 101;
+    public static final String MY_HOST = "my-host";
+    public static final String MY_LAT = "my-lat";
+    public static final String MY_LONG = "my-long";
+    public static final String MY_PARTNER = "my-partner";
+    public static final String MY_PASS = "my-pass";
+    public static final int MY_PORT = 102;
+    public static final String MY_TOPIC = "my-topic";
+    public static final String MY_EFFECTIVE_TOPIC = "my-effective-topic";
+    public static final String MY_USERNAME = "my-user";
+    public static final String MY_PARTITION = "my-partition";
+    public static final String MY_SERIALIZER = "org.apache.kafka.common.serialization.StringSerializer";
+
+    protected Map<String, String> addProps;
+    protected TopicParamsBuilder builder;
+
+    @BeforeEach
+    public void setUp() {
+        addProps = new TreeMap<>();
+        addProps.put("my-key-A", "my-value-A");
+        addProps.put("my-key-B", "my-value-B");
+
+        builder = makeBuilder();
+    }
+
+    @Test
+    void testGetters() {
+        BusTopicParams params = makeBuilder().build();
+
+        Assertions.assertEquals(addProps, params.getAdditionalProps());
+        Assertions.assertEquals(MY_AFT_ENV, params.getAftEnvironment());
+        assertTrue(params.isAllowSelfSignedCerts());
+        Assertions.assertEquals(MY_API_KEY, params.getApiKey());
+        Assertions.assertEquals(MY_API_SECRET, params.getApiSecret());
+        Assertions.assertEquals(MY_BASE_PATH, params.getBasePath());
+        Assertions.assertEquals(MY_CLIENT_NAME, params.getClientName());
+        Assertions.assertEquals(MY_CONS_GROUP, params.getConsumerGroup());
+        Assertions.assertEquals(MY_CONS_INST, params.getConsumerInstance());
+        Assertions.assertEquals(MY_ENV, params.getEnvironment());
+        Assertions.assertEquals(MY_FETCH_LIMIT, params.getFetchLimit());
+        Assertions.assertEquals(MY_FETCH_TIMEOUT, params.getFetchTimeout());
+        Assertions.assertEquals(MY_HOST, params.getHostname());
+        Assertions.assertEquals(MY_LAT, params.getLatitude());
+        Assertions.assertEquals(MY_LONG, params.getLongitude());
+        assertTrue(params.isManaged());
+        Assertions.assertEquals(MY_PARTITION, params.getPartitionId());
+        Assertions.assertEquals(MY_PARTNER, params.getPartner());
+        Assertions.assertEquals(MY_PASS, params.getPassword());
+        Assertions.assertEquals(MY_PORT, params.getPort());
+        Assertions.assertEquals(List.of("localhost"), params.getServers());
+        Assertions.assertEquals(MY_TOPIC, params.getTopic());
+        Assertions.assertEquals(MY_EFFECTIVE_TOPIC, params.getEffectiveTopic());
+        assertTrue(params.isUseHttps());
+        Assertions.assertEquals(MY_USERNAME, params.getUserName());
+    }
+
+    @Test
+    void testBooleanGetters() {
+        // ensure that booleans are independent of each other
+        testBoolean("true:false:false", TopicParamsBuilder::allowSelfSignedCerts);
+        testBoolean("false:true:false", TopicParamsBuilder::managed);
+        testBoolean("false:false:true", TopicParamsBuilder::useHttps);
+    }
+
+    @Test
+    void testValidators() {
+        BusTopicParams params = makeBuilder().build();
+
+        // test validity methods
+        assertTrue(params.isAdditionalPropsValid());
+        assertFalse(params.isAftEnvironmentInvalid());
+        assertTrue(params.isApiKeyValid());
+        assertTrue(params.isApiSecretValid());
+        assertFalse(params.isClientNameInvalid());
+        assertFalse(params.isConsumerGroupInvalid());
+        assertFalse(params.isConsumerInstanceInvalid());
+        assertFalse(params.isEnvironmentInvalid());
+        assertFalse(params.isHostnameInvalid());
+        assertFalse(params.isLatitudeInvalid());
+        assertFalse(params.isLongitudeInvalid());
+        assertFalse(params.isPartitionIdInvalid());
+        assertFalse(params.isPartnerInvalid());
+        assertTrue(params.isPasswordValid());
+        assertFalse(params.isPortInvalid());
+        assertFalse(params.isServersInvalid());
+        assertFalse(params.isTopicInvalid());
+        assertTrue(params.isUserNameValid());
+    }
+
+    @Test
+    void testInvertedValidators() {
+        Assertions.assertFalse(makeBuilder().additionalProps(null).build().isAdditionalPropsValid());
+        Assertions.assertTrue(makeBuilder().aftEnvironment("").build().isAftEnvironmentInvalid());
+        Assertions.assertFalse(makeBuilder().apiKey("").build().isApiKeyValid());
+        Assertions.assertFalse(makeBuilder().apiSecret("").build().isApiSecretValid());
+        Assertions.assertTrue(makeBuilder().clientName("").build().isClientNameInvalid());
+        Assertions.assertTrue(makeBuilder().consumerGroup("").build().isConsumerGroupInvalid());
+        Assertions.assertTrue(makeBuilder().consumerInstance("").build().isConsumerInstanceInvalid());
+        Assertions.assertTrue(makeBuilder().environment("").build().isEnvironmentInvalid());
+        Assertions.assertTrue(makeBuilder().hostname("").build().isHostnameInvalid());
+        Assertions.assertTrue(makeBuilder().latitude("").build().isLatitudeInvalid());
+        Assertions.assertTrue(makeBuilder().longitude("").build().isLongitudeInvalid());
+        Assertions.assertTrue(makeBuilder().partitionId("").build().isPartitionIdInvalid());
+        Assertions.assertTrue(makeBuilder().partner("").build().isPartnerInvalid());
+        Assertions.assertFalse(makeBuilder().password("").build().isPasswordValid());
+        Assertions.assertTrue(makeBuilder().port(-1).build().isPortInvalid());
+        Assertions.assertTrue(makeBuilder().port(65536).build().isPortInvalid());
+        Assertions.assertTrue(makeBuilder().servers(null).build().isServersInvalid());
+        Assertions.assertTrue(makeBuilder().servers(new LinkedList<>()).build().isServersInvalid());
+        Assertions.assertTrue(makeBuilder().servers(List.of("")).build().isServersInvalid());
+        Assertions.assertFalse(makeBuilder().servers(List.of("one-server")).build().isServersInvalid());
+        Assertions.assertTrue(makeBuilder().topic("").build().isTopicInvalid());
+        Assertions.assertFalse(makeBuilder().userName("").build().isUserNameValid());
+    }
+
+    /**
+     * Tests the boolean methods by applying a function, once with {@code false} and once
+     * with {@code true}. Verifies that all the boolean methods return the correct
+     * value by concatenating them.
+     *
+     * @param expectedTrue the string that is expected when {@code true} is passed to the
+     *        method
+     * @param function function to be applied to the builder
+     */
+    private void testBoolean(String expectedTrue, BiConsumer<TopicParamsBuilder, Boolean> function) {
+        TopicParamsBuilder topicParamsBuilder = BusTopicParams.builder();
+
+        // first try the "false" case
+        function.accept(topicParamsBuilder, false);
+
+        BusTopicParams params = topicParamsBuilder.build();
+        assertEquals("false:false:false",
+                        params.isAllowSelfSignedCerts() + ":" + params.isManaged() + ":" + params.isUseHttps());
+
+
+        // now try the "true" case
+        function.accept(topicParamsBuilder, true);
+
+        params = topicParamsBuilder.build();
+        assertEquals(expectedTrue,
+                        params.isAllowSelfSignedCerts() + ":" + params.isManaged() + ":" + params.isUseHttps());
+    }
+
+    public TopicParamsBuilder makeBuilder() {
+
+        return BusTopicParams.builder().additionalProps(addProps).aftEnvironment(MY_AFT_ENV).allowSelfSignedCerts(true)
+            .apiKey(MY_API_KEY).apiSecret(MY_API_SECRET).basePath(MY_BASE_PATH).clientName(MY_CLIENT_NAME)
+            .consumerGroup(MY_CONS_GROUP).consumerInstance(MY_CONS_INST).environment(MY_ENV)
+            .fetchLimit(MY_FETCH_LIMIT).fetchTimeout(MY_FETCH_TIMEOUT).hostname(MY_HOST).latitude(MY_LAT)
+            .longitude(MY_LONG).managed(true).partitionId(MY_PARTITION).partner(MY_PARTNER)
+            .password(MY_PASS).port(MY_PORT).servers(List.of("localhost")).topic(MY_TOPIC)
+            .effectiveTopic(MY_EFFECTIVE_TOPIC).useHttps(true).allowTracing(true).userName(MY_USERNAME)
+            .serializationProvider(MY_SERIALIZER);
+    }
+}
index f7dfdbc..033a8f3 100644 (file)
     <packaging>jar</packaging>
 
     <dependencies>
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.google.re2j</groupId>
+            <artifactId>re2j</artifactId>
+        </dependency>
         <dependency>
             <groupId>jakarta.ws.rs</groupId>
             <artifactId>jakarta.ws.rs-api</artifactId>
             <groupId>org.projectlombok</groupId>
             <artifactId>lombok</artifactId>
         </dependency>
-        <dependency>
-            <groupId>com.google.code.gson</groupId>
-            <artifactId>gson</artifactId>
-        </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
         </dependency>
-        <dependency>
-            <groupId>com.google.re2j</groupId>
-            <artifactId>re2j</artifactId>
-        </dependency>
         <dependency>
             <groupId>org.assertj</groupId>
             <artifactId>assertj-core</artifactId>
index ee55c62..007724a 100644 (file)
@@ -36,7 +36,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
 import java.util.TreeSet;
-import java.util.stream.Collectors;
+import lombok.Getter;
+import lombok.Setter;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.onap.policy.common.gson.annotation.GsonJsonAnyGetter;
@@ -63,20 +64,17 @@ class ClassWalkerTest {
     void testExamineClassOfQ_testExamineField_testExamineInField_testExamineOutField() {
         walker.walkClassHierarchy(DerivedFromBottom.class);
 
-        assertEquals("[Intfc1, Intfc2, Intfc1, Intfc3, Bottom, DerivedFromBottom]", walker.classes.toString());
+        assertEquals("[InterfaceOne, InterfaceTwo, InterfaceOne, InterfaceThree, Bottom, DerivedFromBottom]",
+            walker.classes.toString());
 
-        List<String> inFields = walker.getInProps(Field.class).stream().map(Field::getName)
-                        .collect(Collectors.toList());
-        Collections.sort(inFields);
+        List<String> inFields = walker.getInProps(Field.class).stream().map(Field::getName).sorted().toList();
         assertEquals("[exposedField, overriddenValue, transField]", inFields.toString());
 
-        List<String> outFields = walker.getInProps(Field.class).stream().map(Field::getName)
-                        .collect(Collectors.toList());
-        Collections.sort(outFields);
+        List<String> outFields = walker.getInProps(Field.class).stream().map(Field::getName).sorted().toList();
         assertEquals("[exposedField, overriddenValue, transField]", outFields.toString());
 
         // should work with interfaces without throwing an NPE
-        walker.walkClassHierarchy(Intfc1.class);
+        walker.walkClassHierarchy(InterfaceOne.class);
     }
 
     @Test
@@ -127,17 +125,13 @@ class ClassWalkerTest {
         assertNotNull(walker.getAnyGetter());
         assertEquals("getTheMap", walker.getAnyGetter().getName());
 
-        List<String> getters = walker.getOutProps(Method.class).stream().map(Method::getName)
-                        .collect(Collectors.toList());
-        Collections.sort(getters);
+        List<String> getters = walker.getOutProps(Method.class).stream().map(Method::getName).sorted().toList();
         assertEquals("[getId, getOnlyOut, getValue]", getters.toString());
 
         assertNotNull(walker.getAnySetter());
         assertEquals("setMapValue", walker.getAnySetter().getName());
 
-        List<String> setters = walker.getInProps(Method.class).stream().map(Method::getName)
-                        .collect(Collectors.toList());
-        Collections.sort(setters);
+        List<String> setters = walker.getInProps(Method.class).stream().map(Method::getName).sorted().toList();
         assertEquals("[setId, setOnlyIn, setValue]", setters.toString());
 
         // getter with invalid parameter count
@@ -189,8 +183,8 @@ class ClassWalkerTest {
      * Walker subclass that records items that are examined.
      */
     private static class MyWalker extends ClassWalker {
-        private List<String> classes = new ArrayList<>();
-        private List<String> methods = new ArrayList<>();
+        private final List<String> classes = new ArrayList<>();
+        private final List<String> methods = new ArrayList<>();
 
         @Override
         protected void examine(Class<?> clazz) {
@@ -218,19 +212,19 @@ class ClassWalkerTest {
         }
     }
 
-    protected static interface Intfc1 {
-        int id = 1000;
+    protected interface InterfaceOne {
+        int id = 1000; // NOSONAR I think this is meant to be accessible as fields, not constants
     }
 
-    protected static interface Intfc2 {
-        String text = "intfc2-text";
+    protected interface InterfaceTwo {
+        String text = "intfc2-text"; // NOSONAR I think this is meant to be accessible as fields, not constants
     }
 
-    private static interface Intfc3 {
+    private interface InterfaceThree {
 
     }
 
-    protected static class Bottom implements Intfc1, Intfc3 {
+    protected static class Bottom implements InterfaceOne, InterfaceThree {
         private int id;
         public String value;
 
@@ -259,7 +253,7 @@ class ClassWalkerTest {
         }
     }
 
-    protected static class DerivedFromBottom extends Bottom implements Intfc1, Intfc2 {
+    protected static class DerivedFromBottom extends Bottom implements InterfaceOne, InterfaceTwo {
         private String text;
         protected String anotherValue;
 
@@ -277,29 +271,19 @@ class ClassWalkerTest {
         }
     }
 
+    @Setter
     protected static class Data {
+        @Getter
         private int id;
+        // this will be ignored, because there's already a field by this name
         private String text;
 
-        public int getId() {
-            return id;
-        }
-
-        public void setId(int id) {
-            this.id = id;
-        }
-
         // not public, but property provided
         @GsonJsonProperty("text")
         protected String getText() {
             return text;
         }
 
-        // this will be ignored, because there's already a field by this name
-        public void setText(String text) {
-            this.text = text;
-        }
-
         // should only show up in the output list
         public int getOnlyOut() {
             return 1100;
diff --git a/message-bus/pom.xml b/message-bus/pom.xml
new file mode 100644 (file)
index 0000000..5472479
--- /dev/null
@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ============LICENSE_START=======================================================
+  ONAP Policy Engine - Common Modules
+  ================================================================================
+  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.
+  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  ============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">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.onap.policy.common</groupId>
+        <artifactId>common-modules</artifactId>
+        <version>3.0.1-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>message-bus</artifactId>
+
+    <properties>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>capabilities</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>common-parameters</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>gson</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>utils</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-core</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-databind</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.google.re2j</groupId>
+            <artifactId>re2j</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>io.opentelemetry</groupId>
+            <artifactId>opentelemetry-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.opentelemetry</groupId>
+            <artifactId>opentelemetry-context</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>io.opentelemetry.instrumentation</groupId>
+            <artifactId>opentelemetry-kafka-clients-2.6</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-collections4</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.kafka</groupId>
+            <artifactId>kafka-clients</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <scope>provided</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.mockito</groupId>
+            <artifactId>mockito-junit-jupiter</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>utils-test</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file
@@ -20,7 +20,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm;
+package org.onap.policy.common.message.bus.event;
 
 import java.util.List;
 import org.onap.policy.common.capabilities.Lockable;
@@ -83,7 +83,7 @@ public interface Topic extends TopicRegisterable, Startable, Lockable {
     /**
      * Get the more recent events in this topic entity.
      *
-     * @return list of most recent events
+     * @return array of most recent events
      */
     String[] getRecentEvents();
 
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm;
+package org.onap.policy.common.message.bus.event;
 
 import java.util.List;
 import java.util.Properties;
 import org.onap.policy.common.capabilities.Lockable;
 import org.onap.policy.common.capabilities.Startable;
-import org.onap.policy.common.endpoints.event.comm.bus.KafkaTopicSink;
-import org.onap.policy.common.endpoints.event.comm.bus.KafkaTopicSource;
-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.TopicParameterGroup;
-import org.onap.policy.common.endpoints.parameters.TopicParameters;
+import org.onap.policy.common.message.bus.event.kafka.KafkaTopicSink;
+import org.onap.policy.common.message.bus.event.kafka.KafkaTopicSource;
+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.TopicParameterGroup;
+import org.onap.policy.common.parameters.topic.TopicParameters;
 
 /**
  * Abstraction to manage the system's Networked Topic Endpoints, sources of all events input into
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * 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.
@@ -18,7 +19,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm;
+package org.onap.policy.common.message.bus.event;
 
 import lombok.AccessLevel;
 import lombok.Getter;
@@ -31,5 +32,5 @@ public class TopicEndpointManager {
      * Topic endpoint manager.
      */
     @Getter
-    private static TopicEndpoint manager = new TopicEndpointProxy();
+    static TopicEndpoint manager = new TopicEndpointProxy();
 }
@@ -19,7 +19,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm;
+package org.onap.policy.common.message.bus.event;
 
 import java.util.ArrayList;
 import java.util.Collections;
@@ -28,15 +28,15 @@ import java.util.Objects;
 import java.util.Properties;
 import lombok.Getter;
 import org.onap.policy.common.capabilities.Startable;
-import org.onap.policy.common.endpoints.event.comm.bus.KafkaTopicFactories;
-import org.onap.policy.common.endpoints.event.comm.bus.KafkaTopicSink;
-import org.onap.policy.common.endpoints.event.comm.bus.KafkaTopicSource;
-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.endpoints.event.comm.bus.NoopTopicSource;
-import org.onap.policy.common.endpoints.parameters.TopicParameterGroup;
-import org.onap.policy.common.endpoints.parameters.TopicParameters;
 import org.onap.policy.common.gson.annotation.GsonJsonIgnore;
+import org.onap.policy.common.message.bus.event.kafka.KafkaTopicFactories;
+import org.onap.policy.common.message.bus.event.kafka.KafkaTopicSink;
+import org.onap.policy.common.message.bus.event.kafka.KafkaTopicSource;
+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.message.bus.event.noop.NoopTopicSource;
+import org.onap.policy.common.parameters.topic.TopicParameterGroup;
+import org.onap.policy.common.parameters.topic.TopicParameters;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -1,15 +1,14 @@
 /*-
  * ============LICENSE_START=======================================================
- * policy-endpoints
- * ================================================================================
  * Copyright (C) 2017 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.
  * 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,7 +17,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm;
+package org.onap.policy.common.message.bus.event;
 
 /**
  * Listener for event messages entering the Policy Engine.
@@ -28,11 +27,11 @@ public interface TopicListener {
 
     /**
      * Notification of a new Event over a given Topic.
-     * 
+     *
      * @param commType communication infrastructure type
-     * @param topic topic name
-     * @param event event message as a string
+     * @param topic    topic name
+     * @param event    event message as a string
      */
-    public void onTopicEvent(Topic.CommInfrastructure commType, String topic, String event);
+    void onTopicEvent(Topic.CommInfrastructure commType, String topic, String event);
 
 }
@@ -1,15 +1,14 @@
 /*-
  * ============LICENSE_START=======================================================
- * policy-endpoints
- * ================================================================================
  * Copyright (C) 2017 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.
  * 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,7 +17,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm;
+package org.onap.policy.common.message.bus.event;
 
 /**
  * Marks a Topic entity as registerable.
@@ -27,16 +26,16 @@ public interface TopicRegisterable {
 
     /**
      * Register for notification of events with this Topic Entity.
-     * 
+     *
      * @param topicListener the listener of events
      */
-    public void register(TopicListener topicListener);
+    void register(TopicListener topicListener);
 
     /**
      * Unregisters for notification of events with this Topic Entity.
-     * 
+     *
      * @param topicListener the listener of events
      */
-    public void unregister(TopicListener topicListener);
+    void unregister(TopicListener topicListener);
 
 }
@@ -1,16 +1,14 @@
 /*
  * ============LICENSE_START=======================================================
- * policy-endpoints
- * ================================================================================
  * Copyright (C) 2017-2018 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.
  * 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,7 +17,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm;
+package org.onap.policy.common.message.bus.event;
 
 /**
  * Marks a given Topic Endpoint as able to send messages over a topic.
@@ -28,12 +26,11 @@ public interface TopicSink extends Topic {
 
     /**
      * Sends a string message over this Topic Endpoint.
-     * 
+     *
      * @param message message to send
-     * 
      * @return true if the send operation succeeded, false otherwise
      * @throws IllegalArgumentException an invalid message has been provided
-     * @throws IllegalStateException the entity is in a state that prevents
+     * @throws IllegalStateException    the entity is in a state that prevents
      *         it from sending messages, for example, locked or stopped.
      */
     boolean send(String message);
@@ -1,15 +1,14 @@
 /*-
  * ============LICENSE_START=======================================================
- * policy-endpoints
- * ================================================================================
  * Copyright (C) 2017 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.
  * 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,7 +17,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm;
+package org.onap.policy.common.message.bus.event;
 
 /**
  * Marker for a Topic Entity, indicating that the entity is able to read
@@ -27,11 +26,11 @@ package org.onap.policy.common.endpoints.event.comm;
 public interface TopicSource extends Topic {
 
     /**
-     * Pushes an event into the source programatically.
-     * 
+     * Pushes an event into the source programmatically.
+     *
      * @param event the event in json format
      * @return true if it can be processed correctly, false otherwise
      */
-    public boolean offer(String event);
+    boolean offer(String event);
 
 }
\ No newline at end of file
@@ -1,15 +1,14 @@
 /*-
  * ============LICENSE_START=======================================================
- * policy-endpoints
- * ================================================================================
  * Copyright (C) 2017 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.
  * 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,7 +17,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus;
+package org.onap.policy.common.message.bus.event.base;
 
 /**
  * API.
@@ -26,15 +25,15 @@ package org.onap.policy.common.endpoints.event.comm.bus;
 public interface ApiKeyEnabled {
     /**
      * Get API key.
-     * 
+     *
      * @return api key
      */
-    public String getApiKey();
+    String getApiKey();
 
     /**
      * Get API secret.
-     * 
+     *
      * @return api secret
      */
-    public String getApiSecret();
+    String getApiSecret();
 }
@@ -1,7 +1,5 @@
 /*
  * ============LICENSE_START=======================================================
- * policy-endpoints
- * ================================================================================
  * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2018 Samsung Electronics Co., Ltd.
  * Modifications Copyright (C) 2020,2023 Bell Canada. All rights reserved.
@@ -21,7 +19,9 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus.internal;
+package org.onap.policy.common.message.bus.event.base;
+
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.DEFAULT_TIMEOUT_MS_FETCH;
 
 import io.opentelemetry.api.trace.Span;
 import io.opentelemetry.api.trace.SpanContext;
@@ -48,7 +48,7 @@ import org.apache.kafka.clients.consumer.KafkaConsumer;
 import org.apache.kafka.clients.consumer.OffsetAndMetadata;
 import org.apache.kafka.common.TopicPartition;
 import org.apache.kafka.common.header.Headers;
-import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -63,12 +63,12 @@ public interface BusConsumer {
      * @return list of messages
      * @throws IOException when error encountered by underlying libraries
      */
-    public Iterable<String> fetch() throws IOException;
+    Iterable<String> fetch() throws IOException;
 
     /**
      * close underlying library consumer.
      */
-    public void close();
+    void close();
 
     /**
      * Consumer that handles fetch() failures by sleeping.
@@ -102,10 +102,10 @@ public interface BusConsumer {
             this.fetchTimeout = busTopicParams.getFetchTimeout();
 
             if (this.fetchTimeout <= 0) {
-                this.sleepTime = PolicyEndPointProperties.DEFAULT_TIMEOUT_MS_FETCH;
+                this.sleepTime = DEFAULT_TIMEOUT_MS_FETCH;
             } else {
                 // don't sleep too long, even if fetch timeout is large
-                this.sleepTime = Math.min(this.fetchTimeout, PolicyEndPointProperties.DEFAULT_TIMEOUT_MS_FETCH);
+                this.sleepTime = Math.min(this.fetchTimeout, DEFAULT_TIMEOUT_MS_FETCH);
             }
         }
 
@@ -188,7 +188,7 @@ public interface BusConsumer {
             if (busTopicParams.isAllowTracing()) {
                 this.allowTracing = true;
                 kafkaProps.setProperty(ConsumerConfig.INTERCEPTOR_CLASSES_CONFIG,
-                        TracingConsumerInterceptor.class.getName());
+                    TracingConsumerInterceptor.class.getName());
             }
 
             consumer = new KafkaConsumer<>(kafkaProps);
@@ -233,8 +233,8 @@ public interface BusConsumer {
             }
 
             SpanContext spanContext = SpanContext.createFromRemoteParent(
-                    traceParentInfo.getTraceId(), traceParentInfo.getSpanId(),
-                    TraceFlags.getSampled(), TraceState.builder().build());
+                traceParentInfo.getTraceId(), traceParentInfo.getSpanId(),
+                TraceFlags.getSampled(), TraceState.builder().build());
 
             Context.current().with(Span.wrap(spanContext)).makeCurrent();
         }
@@ -243,7 +243,7 @@ public interface BusConsumer {
             TraceParentInfo traceParentInfo = new TraceParentInfo();
             if (headers.lastHeader("traceparent") != null) {
                 traceParentInfo.setParentTraceId(new String(headers.lastHeader(
-                        "traceparent").value(), StandardCharsets.UTF_8));
+                    "traceparent").value(), StandardCharsets.UTF_8));
 
                 String[] parts = traceParentInfo.getParentTraceId().split("-");
                 traceParentInfo.setTraceId(parts[1]);
diff --git a/message-bus/src/main/java/org/onap/policy/common/message/bus/event/base/BusPublisher.java b/message-bus/src/main/java/org/onap/policy/common/message/bus/event/base/BusPublisher.java
new file mode 100644 (file)
index 0000000..10c7db2
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2018 Samsung Electronics Co., Ltd.
+ * Modifications Copyright (C) 2020,2023 Bell Canada. All rights reserved.
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.common.message.bus.event.base;
+
+public interface BusPublisher {
+
+    String NO_MESSAGE_PROVIDED = "No message provided";
+    String LOG_CLOSE = "{}: CLOSE";
+
+    /**
+     * sends a message.
+     *
+     * @param partitionId id
+     * @param message     the message
+     * @return true if success, false otherwise
+     * @throws IllegalArgumentException if no message provided
+     */
+    boolean send(String partitionId, String message);
+
+    /**
+     * closes the publisher.
+     */
+    void close();
+}
@@ -4,6 +4,7 @@
  * ================================================================================
  * Copyright (C) 2017-2019, 2021 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.
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus.internal;
+package org.onap.policy.common.message.bus.event.base;
 
 import lombok.Getter;
-import org.onap.policy.common.endpoints.event.comm.bus.ApiKeyEnabled;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
 
 /**
  * Bus Topic Base.
@@ -51,7 +52,7 @@ public abstract class BusTopicBase extends TopicBase implements ApiKeyEnabled {
     protected boolean allowTracing;
 
     /**
-     * allow self signed certificates.
+     * allow self-signed certificates.
      */
     protected boolean allowSelfSignedCerts;
 
@@ -59,12 +60,13 @@ public abstract class BusTopicBase extends TopicBase implements ApiKeyEnabled {
      * Instantiates a new Bus Topic Base.
      *
      * <p>servers list of servers
-     *  topic topic name
-     *  apiKey API Key
-     *  apiSecret API Secret
-     *  useHttps does connection use HTTPS?
-     *  allowTracing Is tracing allowed?
-     *  allowSelfSignedCerts are self-signed certificates allow
+     * topic: the topic name
+     * apiKey: API Key
+     * apiSecret: API Secret
+     * useHttps: does connection use HTTPS?
+     * allowTracing: Is tracing allowed?
+     * allowSelfSignedCerts: are self-signed certificates allow
+     *
      * @param busTopicParams holds all our parameters
      * @throws IllegalArgumentException if invalid parameters are present
      */
@@ -101,7 +103,7 @@ public abstract class BusTopicBase extends TopicBase implements ApiKeyEnabled {
     @Override
     public String toString() {
         return "BusTopicBase [apiKey=" + apiKey + ", apiSecret=" + apiSecret + ", useHttps=" + useHttps
-                + ", allowSelfSignedCerts=" + allowSelfSignedCerts + ", toString()=" + super.toString() + "]";
+            + ", allowSelfSignedCerts=" + allowSelfSignedCerts + ", toString()=" + super.toString() + "]";
     }
 
 }
@@ -1,7 +1,5 @@
 /*-
  * ============LICENSE_START=======================================================
- * policy-endpoints
- * ================================================================================
  * Copyright (C) 2017, 2019 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2023-2024 Nordix Foundation.
  * ================================================================================
@@ -19,9 +17,9 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus;
+package org.onap.policy.common.message.bus.event.base;
 
-import org.onap.policy.common.endpoints.event.comm.TopicSink;
+import org.onap.policy.common.message.bus.event.TopicSink;
 
 /**
  * Topic Sink over Bus Infrastructure (KAFKA).
@@ -1,7 +1,5 @@
 /*-
  * ============LICENSE_START=======================================================
- * policy-endpoints
- * ================================================================================
  * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2024 Nordix Foundation.
  * ================================================================================
@@ -19,9 +17,9 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus;
+package org.onap.policy.common.message.bus.event.base;
 
-import org.onap.policy.common.endpoints.event.comm.TopicSource;
+import org.onap.policy.common.message.bus.event.TopicSource;
 
 /**
  * Generic Topic Source for Bus Communication Infrastructure.
@@ -1,7 +1,5 @@
 /*
  * ============LICENSE_START=======================================================
- * policy-endpoints
- * ================================================================================
  * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2018-2019 Samsung Electronics Co., Ltd.
  * Modifications Copyright (C) 2020 Bell Canada. All rights reserved.
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus.internal;
+package org.onap.policy.common.message.bus.event.base;
 
 import java.util.UUID;
 import lombok.Getter;
 import lombok.Setter;
-import org.onap.policy.common.endpoints.event.comm.bus.BusTopicSink;
-import org.onap.policy.common.endpoints.utils.NetLoggerUtil;
-import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType;
+import org.onap.policy.common.message.bus.utils.NetLoggerUtil;
+import org.onap.policy.common.message.bus.utils.NetLoggerUtil.EventType;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -41,7 +39,7 @@ public abstract class InlineBusTopicSink extends BusTopicBase implements BusTopi
     /**
      * Loggers.
      */
-    private static Logger logger = LoggerFactory.getLogger(InlineBusTopicSink.class);
+    private static final Logger logger = LoggerFactory.getLogger(InlineBusTopicSink.class);
 
     /**
      * The partition key to publish to.
@@ -58,14 +56,14 @@ public abstract class InlineBusTopicSink extends BusTopicBase implements BusTopi
     /**
      * Constructor for abstract sink.
      * @param busTopicParams contains below listed attributes
-     *     servers servers
-     *     topic topic
-     *     apiKey api secret
-     *     apiSecret api secret
-     *     partitionId partition id
-     *     useHttps does connection use HTTPS?
-     *     allowTracing is tracing allowed?
-     *     allowSelfSignedCerts are self-signed certificates allow     *
+     *     servers: servers
+     *     topic: topic
+     *     apiKey: api secret
+     *     apiSecret: api secret
+     *     partitionId: partition id
+     *     useHttps: does connection use HTTPS?
+     *     allowTracing: is tracing allowed?
+     *     allowSelfSignedCerts: are self-signed certificates allow     *
      * @throws IllegalArgumentException if invalid parameters are passed in
      */
     protected InlineBusTopicSink(BusTopicParams busTopicParams) {
@@ -1,10 +1,9 @@
 /*-
  * ============LICENSE_START=======================================================
- * policy-endpoints
- * ================================================================================
  * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2018-2019 Samsung Electronics Co., Ltd.
  * 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.
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus.internal;
+package org.onap.policy.common.message.bus.event.base;
+
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.NO_LIMIT_FETCH;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.NO_TIMEOUT_MS_FETCH;
 
 import java.io.IOException;
 import java.net.MalformedURLException;
 import java.util.UUID;
 import lombok.Getter;
-import org.onap.policy.common.endpoints.event.comm.TopicListener;
-import org.onap.policy.common.endpoints.event.comm.bus.BusTopicSource;
-import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
-import org.onap.policy.common.endpoints.utils.NetLoggerUtil;
-import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType;
+import org.onap.policy.common.message.bus.event.TopicListener;
+import org.onap.policy.common.message.bus.utils.NetLoggerUtil;
+import org.onap.policy.common.message.bus.utils.NetLoggerUtil.EventType;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
 import org.onap.policy.common.utils.network.NetworkUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -43,10 +44,10 @@ public abstract class SingleThreadedBusTopicSource extends BusTopicBase
         implements Runnable, BusTopicSource {
 
     /**
-     * Not to be converted to PolicyLogger. This will contain all instract /out traffic and only
+     * Not to be converted to PolicyLogger. This will contain all in/out traffic and only
      * that in a single file in a concise format.
      */
-    private static Logger logger = LoggerFactory.getLogger(SingleThreadedBusTopicSource.class);
+    private static final Logger logger = LoggerFactory.getLogger(SingleThreadedBusTopicSource.class);
 
     /**
      * Bus consumer group.
@@ -112,13 +113,13 @@ public abstract class SingleThreadedBusTopicSource extends BusTopicBase
         }
 
         if (busTopicParams.getFetchTimeout() <= 0) {
-            this.fetchTimeout = PolicyEndPointProperties.NO_TIMEOUT_MS_FETCH;
+            this.fetchTimeout = NO_TIMEOUT_MS_FETCH;
         } else {
             this.fetchTimeout = busTopicParams.getFetchTimeout();
         }
 
         if (busTopicParams.getFetchLimit() <= 0) {
-            this.fetchLimit = PolicyEndPointProperties.NO_LIMIT_FETCH;
+            this.fetchLimit = NO_LIMIT_FETCH;
         } else {
             this.fetchLimit = busTopicParams.getFetchLimit();
         }
@@ -4,7 +4,7 @@
  * ================================================================================
  * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2020 Bell Canada. 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.
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus.internal;
+package org.onap.policy.common.message.bus.event.base;
 
 import java.util.ArrayList;
 import java.util.List;
 import lombok.AccessLevel;
 import lombok.Getter;
 import org.apache.commons.collections4.queue.CircularFifoQueue;
-import org.onap.policy.common.endpoints.event.comm.Topic;
-import org.onap.policy.common.endpoints.event.comm.TopicListener;
+import org.onap.policy.common.message.bus.event.Topic;
+import org.onap.policy.common.message.bus.event.TopicListener;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 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.
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus;
+package org.onap.policy.common.message.bus.event.base;
 
 import java.util.List;
 import java.util.Properties;
-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.message.bus.event.Topic;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
 
 /**
  * Topic Base Factory.
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * 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.
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus;
+package org.onap.policy.common.message.bus.event.base;
 
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Properties;
-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.message.bus.event.Topic;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
 
 /**
  * Topic Factory implementation that indexes T instances in a hash table.
@@ -74,7 +75,7 @@ public abstract class TopicBaseHashedFactory<T extends Topic> implements TopicBa
      * @param topic topic.
      * @return an instance of T.
      */
-    protected abstract T build(List<String> servers, String topic);
+    public abstract T build(List<String> servers, String topic);
 
     /**
      * {@inheritDoc}.
@@ -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.
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.client;
+package org.onap.policy.common.message.bus.event.client;
 
-import jakarta.validation.constraints.NotNull;
 import java.util.Collections;
 import java.util.List;
 import java.util.concurrent.BlockingDeque;
 import java.util.concurrent.LinkedBlockingDeque;
 import java.util.concurrent.TimeUnit;
 import lombok.Getter;
-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.endpoints.event.comm.TopicSource;
+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.onap.policy.common.message.bus.event.TopicSource;
 import org.onap.policy.common.utils.coder.Coder;
 import org.onap.policy.common.utils.coder.CoderException;
 import org.onap.policy.common.utils.coder.StandardCoder;
@@ -178,7 +177,6 @@ public class BidirectionalTopicClient {
         return checkerQueue.peek();
     }
 
-    @NotNull
     private <T> TopicListener getTopicListener(T message) {
         @SuppressWarnings("unchecked")
         final Class<? extends T> clazz = (Class<? extends T>) message.getClass();
@@ -201,7 +199,7 @@ public class BidirectionalTopicClient {
     }
 
     /**
-     * Stops any listeners that are currently stuck in {@link #awaitReady(Object)} by
+     * Stops any listeners that are currently stuck in {@link #awaitReady(Object, long)} by
      * adding {@code false} to the queue.
      */
     public void stopWaiting() {
@@ -3,7 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2020 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.
@@ -19,7 +19,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.client;
+package org.onap.policy.common.message.bus.event.client;
 
 import java.io.Serial;
 
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- * ONAP PAP
+ * ONAP
  * ================================================================================
  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2019, 2024 Nordix Foundation.
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.client;
+package org.onap.policy.common.message.bus.event.client;
 
 import java.util.List;
 import lombok.Getter;
 import lombok.NonNull;
-import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager;
-import org.onap.policy.common.endpoints.event.comm.TopicSink;
+import org.onap.policy.common.message.bus.event.TopicEndpointManager;
+import org.onap.policy.common.message.bus.event.TopicSink;
 import org.onap.policy.common.utils.coder.Coder;
 import org.onap.policy.common.utils.coder.CoderException;
 import org.onap.policy.common.utils.coder.StandardCoder;
@@ -1,9 +1,9 @@
 /*-
  * ============LICENSE_START=======================================================
- * ONAP PAP
+ * ONAP
  * ================================================================================
  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2019, 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 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.
@@ -19,7 +19,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.client;
+package org.onap.policy.common.message.bus.event.client;
 
 import java.io.Serial;
 
@@ -1,6 +1,6 @@
 /*
  * ============LICENSE_START=======================================================
- * Copyright (C) 2022-2023 Nordix Foundation.
+ * 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.
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus;
+package org.onap.policy.common.message.bus.event.kafka;
+
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_KAFKA_SINK_TOPICS;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_TOPIC_SERVERS_SUFFIX;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_TOPIC_SINK_PARTITION_KEY_SUFFIX;
 
 import com.google.re2j.Pattern;
 import java.util.ArrayList;
@@ -24,11 +28,9 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Properties;
 import org.apache.commons.lang3.StringUtils;
-import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
-import org.onap.policy.common.endpoints.event.comm.bus.internal.InlineKafkaTopicSink;
-import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
-import org.onap.policy.common.endpoints.utils.KafkaPropertyUtils;
-import org.onap.policy.common.endpoints.utils.PropertyUtils;
+import org.onap.policy.common.message.bus.utils.KafkaPropertyUtils;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
+import org.onap.policy.common.utils.properties.PropertyUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -89,7 +91,7 @@ class IndexedKafkaTopicSinkFactory implements KafkaTopicSinkFactory {
     @Override
     public List<KafkaTopicSink> build(Properties properties) {
 
-        String writeTopics = properties.getProperty(PolicyEndPointProperties.PROPERTY_KAFKA_SINK_TOPICS);
+        String writeTopics = properties.getProperty(PROPERTY_KAFKA_SINK_TOPICS);
         if (StringUtils.isBlank(writeTopics)) {
             logger.info("{}: no topic for KAFKA Sink", this);
             return new ArrayList<>();
@@ -110,20 +112,20 @@ class IndexedKafkaTopicSinkFactory implements KafkaTopicSinkFactory {
             return;
         }
 
-        String topicPrefix = PolicyEndPointProperties.PROPERTY_KAFKA_SINK_TOPICS + "." + topic;
+        String topicPrefix = PROPERTY_KAFKA_SINK_TOPICS + "." + topic;
 
         var props = new PropertyUtils(properties, topicPrefix,
             (name, value, ex) -> logger.warn("{}: {} {} is in invalid format for topic sink {} ",
                 this, name, value, topic));
 
-        String servers = properties.getProperty(topicPrefix + PolicyEndPointProperties.PROPERTY_TOPIC_SERVERS_SUFFIX);
+        String servers = properties.getProperty(topicPrefix + PROPERTY_TOPIC_SERVERS_SUFFIX);
         if (StringUtils.isBlank(servers)) {
             logger.error("{}: no KAFKA servers configured for sink {}", this, topic);
             return;
         }
 
         KafkaTopicSink kafkaTopicWriter = this.build(KafkaPropertyUtils.makeBuilder(props, topic, servers)
-                .partitionId(props.getString(PolicyEndPointProperties.PROPERTY_TOPIC_SINK_PARTITION_KEY_SUFFIX, null))
+                .partitionId(props.getString(PROPERTY_TOPIC_SINK_PARTITION_KEY_SUFFIX, null))
                 .build());
         newKafkaTopicSinks.add(kafkaTopicWriter);
     }
@@ -1,6 +1,6 @@
 /*
  * ============LICENSE_START=======================================================
- * Copyright (C) 2022-2023 Nordix Foundation.
+ * 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.
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus;
+package org.onap.policy.common.message.bus.event.kafka;
+
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.DEFAULT_LIMIT_FETCH;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.DEFAULT_TIMEOUT_MS_FETCH;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_KAFKA_SOURCE_TOPICS;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_TOPIC_SERVERS_SUFFIX;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_TOPIC_SOURCE_CONSUMER_GROUP_SUFFIX;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_TOPIC_SOURCE_CONSUMER_INSTANCE_SUFFIX;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_TOPIC_SOURCE_FETCH_LIMIT_SUFFIX;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_TOPIC_SOURCE_FETCH_TIMEOUT_SUFFIX;
 
 import com.google.re2j.Pattern;
 import java.util.ArrayList;
@@ -24,11 +33,9 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Properties;
 import org.apache.commons.lang3.StringUtils;
-import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
-import org.onap.policy.common.endpoints.event.comm.bus.internal.SingleThreadedKafkaTopicSource;
-import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
-import org.onap.policy.common.endpoints.utils.KafkaPropertyUtils;
-import org.onap.policy.common.endpoints.utils.PropertyUtils;
+import org.onap.policy.common.message.bus.utils.KafkaPropertyUtils;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
+import org.onap.policy.common.utils.properties.PropertyUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -75,7 +82,7 @@ class IndexedKafkaTopicSourceFactory implements KafkaTopicSourceFactory {
     @Override
     public List<KafkaTopicSource> build(Properties properties) {
 
-        String readTopics = properties.getProperty(PolicyEndPointProperties.PROPERTY_KAFKA_SOURCE_TOPICS);
+        String readTopics = properties.getProperty(PROPERTY_KAFKA_SOURCE_TOPICS);
         if (StringUtils.isBlank(readTopics)) {
             logger.info("{}: no topic for KAFKA Source", this);
             return new ArrayList<>();
@@ -96,8 +103,8 @@ class IndexedKafkaTopicSourceFactory implements KafkaTopicSourceFactory {
                 .servers(servers)
                 .topic(topic)
                 .managed(true)
-                .fetchTimeout(PolicyEndPointProperties.DEFAULT_TIMEOUT_MS_FETCH)
-                .fetchLimit(PolicyEndPointProperties.DEFAULT_LIMIT_FETCH)
+                .fetchTimeout(DEFAULT_TIMEOUT_MS_FETCH)
+                .fetchLimit(DEFAULT_LIMIT_FETCH)
                 .useHttps(false).build());
     }
 
@@ -107,13 +114,13 @@ class IndexedKafkaTopicSourceFactory implements KafkaTopicSourceFactory {
             return;
         }
 
-        String topicPrefix = PolicyEndPointProperties.PROPERTY_KAFKA_SOURCE_TOPICS + "." + topic;
+        String topicPrefix = PROPERTY_KAFKA_SOURCE_TOPICS + "." + topic;
 
         var props = new PropertyUtils(properties, topicPrefix,
             (name, value, ex) -> logger.warn("{}: {} {} is in invalid format for topic source {} ",
                 this, name, value, topic));
 
-        String servers = properties.getProperty(topicPrefix + PolicyEndPointProperties.PROPERTY_TOPIC_SERVERS_SUFFIX);
+        String servers = properties.getProperty(topicPrefix + PROPERTY_TOPIC_SERVERS_SUFFIX);
         if (StringUtils.isBlank(servers)) {
             logger.error("{}: no KAFKA servers configured for source {}", this, topic);
             return;
@@ -121,14 +128,14 @@ class IndexedKafkaTopicSourceFactory implements KafkaTopicSourceFactory {
 
         var kafkaTopicSource = this.build(KafkaPropertyUtils.makeBuilder(props, topic, servers)
                 .consumerGroup(props.getString(
-                        PolicyEndPointProperties.PROPERTY_TOPIC_SOURCE_CONSUMER_GROUP_SUFFIX, null))
+                        PROPERTY_TOPIC_SOURCE_CONSUMER_GROUP_SUFFIX, null))
                 .consumerInstance(props.getString(
-                        PolicyEndPointProperties.PROPERTY_TOPIC_SOURCE_CONSUMER_INSTANCE_SUFFIX, null))
+                        PROPERTY_TOPIC_SOURCE_CONSUMER_INSTANCE_SUFFIX, null))
                 .fetchTimeout(props.getInteger(
-                        PolicyEndPointProperties.PROPERTY_TOPIC_SOURCE_FETCH_TIMEOUT_SUFFIX,
-                        PolicyEndPointProperties.DEFAULT_TIMEOUT_MS_FETCH))
-                .fetchLimit(props.getInteger(PolicyEndPointProperties.PROPERTY_TOPIC_SOURCE_FETCH_LIMIT_SUFFIX,
-                        PolicyEndPointProperties.DEFAULT_LIMIT_FETCH))
+                        PROPERTY_TOPIC_SOURCE_FETCH_TIMEOUT_SUFFIX,
+                        DEFAULT_TIMEOUT_MS_FETCH))
+                .fetchLimit(props.getInteger(PROPERTY_TOPIC_SOURCE_FETCH_LIMIT_SUFFIX,
+                        DEFAULT_LIMIT_FETCH))
                 .build());
 
         newKafkaTopicSources.add(kafkaTopicSource);
@@ -1,6 +1,6 @@
 /*
  * ============LICENSE_START=======================================================
- * Copyright (C) 2022-2023 Nordix Foundation.
+ * 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.
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus.internal;
+package org.onap.policy.common.message.bus.event.kafka;
 
 import java.util.Map;
-import org.onap.policy.common.endpoints.event.comm.Topic;
-import org.onap.policy.common.endpoints.event.comm.bus.KafkaTopicSink;
+import org.onap.policy.common.message.bus.event.Topic;
+import org.onap.policy.common.message.bus.event.base.InlineBusTopicSink;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -59,7 +60,7 @@ public class InlineKafkaTopicSink extends InlineBusTopicSink implements KafkaTop
     @Override
     public void init() {
 
-        this.publisher = new BusPublisher.KafkaPublisherWrapper(BusTopicParams.builder()
+        this.publisher = new KafkaPublisherWrapper(BusTopicParams.builder()
                 .servers(this.servers)
                 .topic(this.effectiveTopic)
                 .useHttps(this.useHttps)
diff --git a/message-bus/src/main/java/org/onap/policy/common/message/bus/event/kafka/KafkaPublisherWrapper.java b/message-bus/src/main/java/org/onap/policy/common/message/bus/event/kafka/KafkaPublisherWrapper.java
new file mode 100644 (file)
index 0000000..86b9e93
--- /dev/null
@@ -0,0 +1,121 @@
+/*
+ * ============LICENSE_START=======================================================
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.common.message.bus.event.kafka;
+
+import io.opentelemetry.instrumentation.kafkaclients.v2_6.TracingProducerInterceptor;
+import java.util.Properties;
+import java.util.UUID;
+import org.apache.kafka.clients.producer.KafkaProducer;
+import org.apache.kafka.clients.producer.Producer;
+import org.apache.kafka.clients.producer.ProducerConfig;
+import org.apache.kafka.clients.producer.ProducerRecord;
+import org.onap.policy.common.message.bus.event.base.BusPublisher;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Kafka based library publisher.
+ */
+public class KafkaPublisherWrapper implements BusPublisher {
+
+    private static final Logger logger = LoggerFactory.getLogger(KafkaPublisherWrapper.class);
+    private static final String KEY_SERIALIZER = "org.apache.kafka.common.serialization.StringSerializer";
+
+    private final String topic;
+
+    /**
+     * Kafka publisher.
+     */
+    private final Producer<String, String> producer;
+    protected Properties kafkaProps;
+
+    /**
+     * Kafka Publisher Wrapper.
+     *
+     * @param busTopicParams topic parameters
+     */
+    public KafkaPublisherWrapper(BusTopicParams busTopicParams) {
+
+        if (busTopicParams.isTopicInvalid()) {
+            throw new IllegalArgumentException("No topic for Kafka");
+        }
+
+        this.topic = busTopicParams.getTopic();
+
+        // Setup Properties for consumer
+        kafkaProps = new Properties();
+        kafkaProps.setProperty(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, busTopicParams.getServers().get(0));
+        if (busTopicParams.isAdditionalPropsValid()) {
+            kafkaProps.putAll(busTopicParams.getAdditionalProps());
+        }
+
+        if (kafkaProps.get(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG) == null) {
+            kafkaProps.setProperty(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, KEY_SERIALIZER);
+        }
+
+        if (kafkaProps.get(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG) == null) {
+            kafkaProps.setProperty(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, KEY_SERIALIZER);
+        }
+
+        if (busTopicParams.isAllowTracing()) {
+            kafkaProps.setProperty(ProducerConfig.INTERCEPTOR_CLASSES_CONFIG,
+                TracingProducerInterceptor.class.getName());
+        }
+
+        producer = new KafkaProducer<>(kafkaProps);
+    }
+
+    @Override
+    public boolean send(String partitionId, String message) {
+        if (message == null) {
+            throw new IllegalArgumentException(NO_MESSAGE_PROVIDED);
+        }
+
+        try {
+            // Create the record
+            ProducerRecord<String, String> producerRecord =
+                new ProducerRecord<>(topic, UUID.randomUUID().toString(), message);
+
+            this.producer.send(producerRecord);
+            producer.flush();
+        } catch (Exception e) {
+            logger.warn("{}: SEND of {} cannot be performed because of {}", this, message, e.getMessage(), e);
+            return false;
+        }
+        return true;
+    }
+
+    @Override
+    public void close() {
+        logger.info(LOG_CLOSE, this);
+
+        try {
+            this.producer.close();
+        } catch (Exception e) {
+            logger.warn("{}: CLOSE FAILED because of {}", this, e.getMessage(), e);
+        }
+    }
+
+    @Override
+    public String toString() {
+        return "KafkaPublisherWrapper []";
+    }
+
+}
@@ -1,6 +1,6 @@
 /*
  * ============LICENSE_START=======================================================
- * Copyright (C) 2022 Nordix Foundation.
+ * 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.
@@ -16,7 +16,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus;
+package org.onap.policy.common.message.bus.event.kafka;
 
 import lombok.AccessLevel;
 import lombok.Getter;
@@ -1,6 +1,6 @@
 /*
  * ============LICENSE_START=======================================================
- * Copyright (C) 2022 Nordix Foundation.
+ * 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.
@@ -16,7 +16,9 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus;
+package org.onap.policy.common.message.bus.event.kafka;
+
+import org.onap.policy.common.message.bus.event.base.BusTopicSink;
 
 /**
  * Topic Writer over KAFKA Infrastructure.
@@ -1,6 +1,6 @@
 /*
  * ============LICENSE_START=======================================================
- * Copyright (C) 2022 Nordix Foundation.
+ * 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.
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus;
+package org.onap.policy.common.message.bus.event.kafka;
 
 import java.util.List;
 import java.util.Properties;
-import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
 
 /**
  * KAFKA Topic Sink Factory.
@@ -1,6 +1,6 @@
 /*
  * ============LICENSE_START=======================================================
- * Copyright (C) 2022 Nordix Foundation.
+ * 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.
@@ -16,7 +16,9 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus;
+package org.onap.policy.common.message.bus.event.kafka;
+
+import org.onap.policy.common.message.bus.event.base.BusTopicSource;
 
 /**
  * Kafka Topic Source.
@@ -1,6 +1,6 @@
 /*
  * ============LICENSE_START=======================================================
- * Copyright (C) 2022-2023 Nordix Foundation.
+ * 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.
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus;
+package org.onap.policy.common.message.bus.event.kafka;
 
 import java.util.List;
 import java.util.Properties;
-import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
 
 /**
  * Kafka Topic Source Factory.
@@ -1,6 +1,6 @@
 /*
  * ============LICENSE_START=======================================================
- * Copyright (C) 2022-2023 Nordix Foundation.
+ * 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.
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus.internal;
+package org.onap.policy.common.message.bus.event.kafka;
 
-import java.net.MalformedURLException;
 import java.util.Map;
-import org.onap.policy.common.endpoints.event.comm.Topic;
-import org.onap.policy.common.endpoints.event.comm.bus.KafkaTopicSource;
+import org.onap.policy.common.message.bus.event.Topic;
+import org.onap.policy.common.message.bus.event.base.BusConsumer;
+import org.onap.policy.common.message.bus.event.base.SingleThreadedBusTopicSource;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
 
 /**
  * This topic source implementation specializes in reading messages over a Kafka Bus topic source and
@@ -48,10 +49,10 @@ public class SingleThreadedKafkaTopicSource extends SingleThreadedBusTopicSource
     }
 
     /**
-     * Initialize the Cambria client.
+     * Initialize the client.
      */
     @Override
-    public void init() throws MalformedURLException {
+    public void init() {
         BusTopicParams.TopicParamsBuilder builder = BusTopicParams.builder()
                 .servers(this.servers)
                 .topic(this.effectiveTopic)
@@ -5,6 +5,7 @@
  * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2019 Samsung Electronics Co., Ltd.
  * 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.
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus;
+package org.onap.policy.common.message.bus.event.noop;
 
 import java.util.List;
-import org.onap.policy.common.endpoints.event.comm.bus.internal.TopicBase;
-import org.onap.policy.common.endpoints.utils.NetLoggerUtil;
-import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType;
+import org.onap.policy.common.message.bus.event.base.TopicBase;
+import org.onap.policy.common.message.bus.utils.NetLoggerUtil;
+import org.onap.policy.common.message.bus.utils.NetLoggerUtil.EventType;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -37,7 +38,7 @@ public abstract class NoopTopicEndpoint extends TopicBase {
     /**
      * Logger.
      */
-    private static Logger logger = LoggerFactory.getLogger(NoopTopicEndpoint.class);
+    private static final Logger logger = LoggerFactory.getLogger(NoopTopicEndpoint.class);
 
     /**
      * Constructs the object.
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * 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.
@@ -18,7 +19,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus;
+package org.onap.policy.common.message.bus.event.noop;
 
 import lombok.AccessLevel;
 import lombok.Getter;
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * 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.
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus;
+package org.onap.policy.common.message.bus.event.noop;
+
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_MANAGED_SUFFIX;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_TOPIC_SERVERS_SUFFIX;
 
 import com.google.re2j.Pattern;
 import java.util.ArrayList;
@@ -26,8 +30,8 @@ import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 import java.util.Properties;
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
-import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.event.base.TopicBaseHashedFactory;
 
 /**
  * Noop Topic Factory.
@@ -62,7 +66,7 @@ public abstract class NoopTopicFactory<T extends NoopTopicEndpoint> extends Topi
     protected List<String> getServers(String topicName, Properties properties) {
         String servers =
             properties.getProperty(getTopicsPropertyName() + "." + topicName
-                + PolicyEndPointProperties.PROPERTY_TOPIC_SERVERS_SUFFIX);
+                + PROPERTY_TOPIC_SERVERS_SUFFIX);
 
         if (servers == null || servers.isEmpty()) {
             servers = CommInfrastructure.NOOP.toString();
@@ -77,8 +81,7 @@ public abstract class NoopTopicFactory<T extends NoopTopicEndpoint> extends Topi
     @Override
     protected boolean isManaged(String topicName, Properties properties) {
         var managedString =
-            properties.getProperty(getTopicsPropertyName()
-                + "." + topicName + PolicyEndPointProperties.PROPERTY_MANAGED_SUFFIX);
+            properties.getProperty(getTopicsPropertyName() + "." + topicName + PROPERTY_MANAGED_SUFFIX);
 
         var managed = true;
         if (managedString != null && !managedString.isEmpty()) {
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2017-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.
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus;
+package org.onap.policy.common.message.bus.event.noop;
 
 import java.util.List;
-import org.onap.policy.common.endpoints.event.comm.TopicSink;
-import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType;
+import org.onap.policy.common.message.bus.event.TopicSink;
+import org.onap.policy.common.message.bus.utils.NetLoggerUtil.EventType;
 
 /**
  * No Operation Topic Sink.
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2017-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.
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus;
+package org.onap.policy.common.message.bus.event.noop;
+
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_NOOP_SINK_TOPICS;
 
 import java.util.List;
-import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
 
 /**
  * Noop Topic Sink Factory.
@@ -33,14 +35,14 @@ public class NoopTopicSinkFactory extends NoopTopicFactory<NoopTopicSink> {
      */
     @Override
     protected String getTopicsPropertyName() {
-        return PolicyEndPointProperties.PROPERTY_NOOP_SINK_TOPICS;
+        return PROPERTY_NOOP_SINK_TOPICS;
     }
 
     /**
      * {@inheritDoc}.
      */
     @Override
-    protected NoopTopicSink build(List<String> servers, String topic) {
+    public NoopTopicSink build(List<String> servers, String topic) {
         return new NoopTopicSink(servers, topic);
     }
 
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 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.
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus;
+package org.onap.policy.common.message.bus.event.noop;
 
 import java.util.List;
-import org.onap.policy.common.endpoints.event.comm.TopicSource;
-import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType;
+import org.onap.policy.common.message.bus.event.TopicSource;
+import org.onap.policy.common.message.bus.utils.NetLoggerUtil.EventType;
 
 /**
  * No Operation Topic Source.
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 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.
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus;
+package org.onap.policy.common.message.bus.event.noop;
+
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_NOOP_SOURCE_TOPICS;
 
 import java.util.List;
-import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
 
 /**
  * No Operation Topic Source Factory.
@@ -33,14 +35,14 @@ public class NoopTopicSourceFactory extends NoopTopicFactory<NoopTopicSource> {
      */
     @Override
     protected String getTopicsPropertyName() {
-        return PolicyEndPointProperties.PROPERTY_NOOP_SOURCE_TOPICS;
+        return PROPERTY_NOOP_SOURCE_TOPICS;
     }
 
     /**
      * {@inheritDoc}.
      */
     @Override
-    protected NoopTopicSource build(List<String> servers, String topic) {
+    public NoopTopicSource build(List<String> servers, String topic) {
         return new NoopTopicSource(servers, topic);
     }
 
@@ -1,8 +1,7 @@
 /*
  * ============LICENSE_START=======================================================
- * policy-endpoints
- * ================================================================================
  * Copyright (C) 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.
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.features;
+package org.onap.policy.common.message.bus.features;
 
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
-import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.utils.NetLoggerUtil.EventType;
 import org.onap.policy.common.utils.services.OrderedService;
 import org.slf4j.Logger;
 
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * 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.
@@ -18,7 +19,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.features;
+package org.onap.policy.common.message.bus.features;
 
 import lombok.AccessLevel;
 import lombok.Getter;
diff --git a/message-bus/src/main/java/org/onap/policy/common/message/bus/properties/MessageBusProperties.java b/message-bus/src/main/java/org/onap/policy/common/message/bus/properties/MessageBusProperties.java
new file mode 100644 (file)
index 0000000..9aa529f
--- /dev/null
@@ -0,0 +1,78 @@
+/*-
+ * ============LICENSE_START===============================================
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=================================================
+ */
+
+package org.onap.policy.common.message.bus.properties;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class MessageBusProperties {
+
+    /* Generic property suffixes */
+
+    public static final String PROPERTY_TOPIC_SERVERS_SUFFIX = ".servers";
+    public static final String PROPERTY_TOPIC_EFFECTIVE_TOPIC_SUFFIX = ".effectiveTopic";
+
+    public static final String PROPERTY_TOPIC_SOURCE_CONSUMER_GROUP_SUFFIX = ".consumerGroup";
+    public static final String PROPERTY_TOPIC_SOURCE_CONSUMER_INSTANCE_SUFFIX = ".consumerInstance";
+    public static final String PROPERTY_TOPIC_SOURCE_FETCH_TIMEOUT_SUFFIX = ".fetchTimeout";
+    public static final String PROPERTY_TOPIC_SOURCE_FETCH_LIMIT_SUFFIX = ".fetchLimit";
+    public static final String PROPERTY_MANAGED_SUFFIX = ".managed";
+    public static final String PROPERTY_ADDITIONAL_PROPS_SUFFIX = ".additionalProps";
+
+    public static final String PROPERTY_TOPIC_SINK_PARTITION_KEY_SUFFIX = ".partitionKey";
+
+    public static final String PROPERTY_ALLOW_SELF_SIGNED_CERTIFICATES_SUFFIX = ".selfSignedCertificates";
+
+    public static final String PROPERTY_NOOP_SOURCE_TOPICS = "noop.source.topics";
+    public static final String PROPERTY_NOOP_SINK_TOPICS = "noop.sink.topics";
+
+    /* KAFKA Properties */
+
+    public static final String PROPERTY_KAFKA_SOURCE_TOPICS = "kafka.source.topics";
+    public static final String PROPERTY_KAFKA_SINK_TOPICS = "kafka.sink.topics";
+
+    /* HTTP Server Properties */
+
+    public static final String PROPERTY_HTTP_HTTPS_SUFFIX = ".https";
+
+    /* Topic Sink Values */
+
+    /* Topic Source values */
+
+    /**
+     * Default Timeout fetching in milliseconds.
+     */
+    public static final int DEFAULT_TIMEOUT_MS_FETCH = 15000;
+
+    /**
+     * Default maximum number of messages fetch at the time.
+     */
+    public static final int DEFAULT_LIMIT_FETCH = 100;
+
+    /**
+     * Definition of No Timeout fetching.
+     */
+    public static final int NO_TIMEOUT_MS_FETCH = -1;
+
+    /**
+     * Definition of No limit fetching.
+     */
+    public static final int NO_LIMIT_FETCH = -1;
+}
@@ -2,8 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP
  * ================================================================================
- * Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2022-2024 Nordix Foundation.
+ * 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.
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.utils;
+package org.onap.policy.common.message.bus.utils;
 
-import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_ADDITIONAL_PROPS_SUFFIX;
-import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_MANAGED_SUFFIX;
-import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_TOPIC_EFFECTIVE_TOPIC_SUFFIX;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_ADDITIONAL_PROPS_SUFFIX;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_MANAGED_SUFFIX;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_TOPIC_EFFECTIVE_TOPIC_SUFFIX;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.google.re2j.Pattern;
@@ -35,8 +34,9 @@ import java.util.List;
 import java.util.Map;
 import lombok.AccessLevel;
 import lombok.NoArgsConstructor;
-import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
-import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams.TopicParamsBuilder;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
+import org.onap.policy.common.parameters.topic.BusTopicParams.TopicParamsBuilder;
+import org.onap.policy.common.utils.properties.PropertyUtils;
 
 @NoArgsConstructor(access = AccessLevel.PRIVATE)
 public class KafkaPropertyUtils {
@@ -1,8 +1,7 @@
 /*
  * ============LICENSE_START=======================================================
- * policy-endpoints
- * ================================================================================
  * 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.
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.utils;
+package org.onap.policy.common.message.bus.utils;
 
 import lombok.Getter;
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
-import org.onap.policy.common.endpoints.features.NetLoggerFeatureProviders;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.features.NetLoggerFeatureProviders;
 import org.onap.policy.common.utils.services.FeatureApiUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -2,7 +2,6 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019, 2024 Nordix Foundation.
  *  Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
-
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.parameters;
+package org.onap.policy.common.message.bus.event;
 
 import java.io.File;
 import java.io.IOException;
-import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
-import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
 import org.onap.policy.common.parameters.ParameterGroup;
+import org.onap.policy.common.parameters.topic.TopicParameters;
 import org.onap.policy.common.utils.coder.Coder;
 import org.onap.policy.common.utils.coder.CoderException;
 import org.onap.policy.common.utils.coder.StandardCoder;
@@ -42,36 +40,28 @@ import org.onap.policy.common.utils.coder.StandardCoder;
  */
 public class CommonTestData {
 
-    public static final String REST_SERVER_PASS = "zb!XztG34";
-    public static final String REST_SERVER_USER = "healthcheck";
-    public static final int REST_SERVER_PORT = 6969;
-    public static final String REST_SERVER_HOST = "0.0.0.0";
-    public static final boolean REST_SERVER_HTTPS = true;
-    public static final boolean REST_SERVER_AAF = false;
-
     public static final String TOPIC_NAME = "policy-pdp-pap";
     public static final String TOPIC_INFRA = "kafka";
     public static final String TOPIC_SERVER = "kafka:9092";
 
     public static final List<TopicParameters> TOPIC_PARAMS =
-        Arrays.asList(getTopicParameters(TOPIC_NAME, TOPIC_INFRA, TOPIC_SERVER));
+        List.of(getTopicParameters(TOPIC_NAME, TOPIC_INFRA, TOPIC_SERVER));
 
     protected static final Coder coder = new StandardCoder();
 
     /**
      * Create topic parameters for test cases.
      *
-     * @param topicName name of topic
-     * @param topicInfra topicCommInfrastructure
+     * @param topicName   name of topic
+     * @param topicInfra  topicCommInfrastructure
      * @param topicServer topic server
-     *
      * @return topic parameters
      */
     public static TopicParameters getTopicParameters(String topicName, String topicInfra, String topicServer) {
         final TopicParameters topicParams = new TopicParameters();
         topicParams.setTopic(topicName);
         topicParams.setTopicCommInfrastructure(topicInfra);
-        topicParams.setServers(Arrays.asList(topicServer));
+        topicParams.setServers(List.of(topicServer));
         return topicParams;
     }
 
@@ -79,7 +69,7 @@ public class CommonTestData {
      * Converts the contents of a map to a parameter class.
      *
      * @param source property map
-     * @param clazz class of object to be created from the map
+     * @param clazz  class of object to be created from the map
      * @return a new object represented by the map
      */
     public <T extends ParameterGroup> T toObject(final Map<String, Object> source, final Class<T> clazz) {
@@ -91,27 +81,6 @@ public class CommonTestData {
         }
     }
 
-    /**
-     * Returns a property map for a RestServerParameters map for test cases.
-     *
-     * @param isEmpty boolean value to represent that object created should be empty or not
-     * @return a property map suitable for constructing an object
-     */
-    public Map<String, Object> getRestServerParametersMap(final boolean isEmpty) {
-        final Map<String, Object> map = new TreeMap<>();
-        map.put("https", REST_SERVER_HTTPS);
-        map.put("aaf", REST_SERVER_AAF);
-
-        if (!isEmpty) {
-            map.put("host", REST_SERVER_HOST);
-            map.put("port", REST_SERVER_PORT);
-            map.put("userName", REST_SERVER_USER);
-            map.put("password", REST_SERVER_PASS);
-        }
-
-        return map;
-    }
-
     /**
      * Returns a property map for a TopicParameters map for test cases.
      *
@@ -137,6 +106,6 @@ public class CommonTestData {
      */
     public String getParameterGroupAsString(String filePath) throws IOException {
         File file = new File(filePath);
-        return new String(Files.readAllBytes(file.toPath()), StandardCharsets.UTF_8);
+        return Files.readString(file.toPath());
     }
 }
@@ -19,7 +19,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm;
+package org.onap.policy.common.message.bus.event;
 
 import static org.assertj.core.api.Assertions.assertThatCode;
 import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
@@ -35,14 +35,14 @@ import java.util.List;
 import java.util.Properties;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.Test;
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
-import org.onap.policy.common.endpoints.event.comm.bus.KafkaTopicFactories;
-import org.onap.policy.common.endpoints.event.comm.bus.KafkaTopicPropertyBuilder;
-import org.onap.policy.common.endpoints.event.comm.bus.NoopTopicFactories;
-import org.onap.policy.common.endpoints.event.comm.bus.NoopTopicPropertyBuilder;
-import org.onap.policy.common.endpoints.parameters.TopicParameterGroup;
-import org.onap.policy.common.endpoints.parameters.TopicParameters;
-import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.event.kafka.KafkaTopicFactories;
+import org.onap.policy.common.message.bus.event.kafka.KafkaTopicPropertyBuilder;
+import org.onap.policy.common.message.bus.event.noop.NoopTopicFactories;
+import org.onap.policy.common.message.bus.event.noop.NoopTopicPropertyBuilder;
+import org.onap.policy.common.message.bus.properties.MessageBusProperties;
+import org.onap.policy.common.parameters.topic.TopicParameterGroup;
+import org.onap.policy.common.parameters.topic.TopicParameters;
 import org.onap.policy.common.utils.gson.GsonTestUtils;
 
 class TopicEndpointProxyTest {
@@ -64,19 +64,19 @@ class TopicEndpointProxyTest {
         group.setTopicSources(new LinkedList<>());
 
         NoopTopicPropertyBuilder noopSourceBuilder =
-                new NoopTopicPropertyBuilder(PolicyEndPointProperties.PROPERTY_NOOP_SOURCE_TOPICS)
+                new NoopTopicPropertyBuilder(MessageBusProperties.PROPERTY_NOOP_SOURCE_TOPICS)
                         .makeTopic(NOOP_SOURCE_TOPIC);
         configuration.putAll(noopSourceBuilder.build());
         group.getTopicSources().add(noopSourceBuilder.getParams());
 
         NoopTopicPropertyBuilder noopSinkBuilder =
-                new NoopTopicPropertyBuilder(PolicyEndPointProperties.PROPERTY_NOOP_SINK_TOPICS)
+                new NoopTopicPropertyBuilder(MessageBusProperties.PROPERTY_NOOP_SINK_TOPICS)
                         .makeTopic(NOOP_SINK_TOPIC);
         configuration.putAll(noopSinkBuilder.build());
         group.getTopicSinks().add(noopSinkBuilder.getParams());
 
         TopicParameters invalidCommInfraParams =
-                new NoopTopicPropertyBuilder(PolicyEndPointProperties.PROPERTY_NOOP_SOURCE_TOPICS)
+                new NoopTopicPropertyBuilder(MessageBusProperties.PROPERTY_NOOP_SOURCE_TOPICS)
                         .makeTopic(NOOP_SOURCE_TOPIC).getParams();
         invalidCommInfraParams.setTopicCommInfrastructure(Topic.CommInfrastructure.REST.name());
         group.getTopicSources().add(invalidCommInfraParams);
@@ -145,7 +145,7 @@ class TopicEndpointProxyTest {
         TopicEndpoint manager = new TopicEndpointProxy();
 
         KafkaTopicPropertyBuilder kafkaTopicPropertyBuilder =
-            new KafkaTopicPropertyBuilder(PolicyEndPointProperties.PROPERTY_KAFKA_SOURCE_TOPICS)
+            new KafkaTopicPropertyBuilder(MessageBusProperties.PROPERTY_KAFKA_SOURCE_TOPICS)
                 .makeTopic(KAFKA_SOURCE_TOPIC);
 
         configuration.putAll(kafkaTopicPropertyBuilder.build());
@@ -189,7 +189,7 @@ class TopicEndpointProxyTest {
         assertSame(1, sinks.size());
 
         KafkaTopicPropertyBuilder kafkaTopicPropertyBuilder =
-            new KafkaTopicPropertyBuilder(PolicyEndPointProperties.PROPERTY_KAFKA_SINK_TOPICS)
+            new KafkaTopicPropertyBuilder(MessageBusProperties.PROPERTY_KAFKA_SINK_TOPICS)
                 .makeTopic(KAFKA_SINK_TOPIC);
 
         configuration.putAll(kafkaTopicPropertyBuilder.build());
@@ -19,7 +19,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.parameters;
+package org.onap.policy.common.message.bus.event;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertFalse;
@@ -32,8 +32,10 @@ import java.lang.reflect.Modifier;
 import java.util.List;
 import org.apache.commons.lang3.StringUtils;
 import org.junit.jupiter.api.Test;
-import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
 import org.onap.policy.common.parameters.ValidationResult;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
+import org.onap.policy.common.parameters.topic.TopicParameterGroup;
+import org.onap.policy.common.parameters.topic.TopicParameters;
 import org.onap.policy.common.utils.coder.Coder;
 import org.onap.policy.common.utils.coder.CoderException;
 import org.onap.policy.common.utils.coder.StandardCoder;
@@ -44,8 +46,9 @@ import org.onap.policy.common.utils.coder.StandardCoder;
  * @author Ajith Sreekumar (ajith.sreekumar@est.tech)
  */
 class TopicParameterGroupTest {
-    private static CommonTestData testData = new CommonTestData();
+    private static final CommonTestData testData = new CommonTestData();
     private static final Coder coder = new StandardCoder();
+    private final String packageDir = "src/test/resources/org/onap/policy/common/message/bus/parameters/";
 
     @Test
     void test() throws CoderException {
@@ -76,7 +79,7 @@ class TopicParameterGroupTest {
     @Test
     void test_valid() throws Exception {
         String json = testData.getParameterGroupAsString(
-            "src/test/resources/org/onap/policy/common/endpoints/parameters/TopicParameters_valid.json");
+            packageDir + "TopicParameters_valid.json");
         TopicParameterGroup topicParameterGroup = coder.decode(json, TopicParameterGroup.class);
         final ValidationResult result = topicParameterGroup.validate();
         assertNull(result.getResult());
@@ -86,7 +89,7 @@ class TopicParameterGroupTest {
     @Test
     void test_invalid() throws Exception {
         String json = testData.getParameterGroupAsString(
-            "src/test/resources/org/onap/policy/common/endpoints/parameters/TopicParameters_invalid.json");
+            packageDir + "TopicParameters_invalid.json");
         TopicParameterGroup topicParameterGroup = coder.decode(json, TopicParameterGroup.class);
         final ValidationResult result = topicParameterGroup.validate();
         assertFalse(result.isValid());
@@ -96,7 +99,7 @@ class TopicParameterGroupTest {
     @Test
     void test_missing_mandatory_params() throws Exception {
         String json = testData.getParameterGroupAsString(
-            "src/test/resources/org/onap/policy/common/endpoints/parameters/TopicParameters_missing_mandatory.json");
+            packageDir + "TopicParameters_missing_mandatory.json");
         TopicParameterGroup topicParameterGroup = coder.decode(json, TopicParameterGroup.class);
         final ValidationResult result = topicParameterGroup.validate();
         assertTrue(result.getResult().contains("Mandatory parameters are missing"));
@@ -104,9 +107,9 @@ class TopicParameterGroupTest {
     }
 
     @Test
-    void test_allparams() throws Exception {
+    void test_allParams() throws Exception {
         String json = testData.getParameterGroupAsString(
-            "src/test/resources/org/onap/policy/common/endpoints/parameters/TopicParameters_all_params.json");
+            packageDir + "TopicParameters_all_params.json");
         TopicParameterGroup topicParameterGroup = coder.decode(json, TopicParameterGroup.class);
         final ValidationResult result = topicParameterGroup.validate();
         assertNull(result.getResult());
@@ -1,7 +1,5 @@
 /*
  * ============LICENSE_START=======================================================
- * policy-endpoints
- * ================================================================================
  * Copyright (C) 2018-2021 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2023-2024 Nordix Foundation.
  * ================================================================================
@@ -19,7 +17,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus.internal;
+package org.onap.policy.common.message.bus.event.base;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatCode;
@@ -51,10 +49,10 @@ import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
-import org.onap.policy.common.endpoints.event.comm.bus.TopicTestBase;
-import org.onap.policy.common.endpoints.event.comm.bus.internal.BusConsumer.FetchingBusConsumer;
-import org.onap.policy.common.endpoints.event.comm.bus.internal.BusConsumer.KafkaConsumerWrapper;
-import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
+import org.onap.policy.common.message.bus.event.base.BusConsumer.FetchingBusConsumer;
+import org.onap.policy.common.message.bus.event.base.BusConsumer.KafkaConsumerWrapper;
+import org.onap.policy.common.message.bus.properties.MessageBusProperties;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
 
 class BusConsumerTest extends TopicTestBase {
 
@@ -83,16 +81,16 @@ class BusConsumerTest extends TopicTestBase {
     void testFetchingBusConsumer() {
         // should not be negative
         var cons = new FetchingBusConsumerImpl(makeBuilder().fetchTimeout(-1).build());
-        assertThat(cons.getSleepTime()).isEqualTo(PolicyEndPointProperties.DEFAULT_TIMEOUT_MS_FETCH);
+        assertThat(cons.getSleepTime()).isEqualTo(MessageBusProperties.DEFAULT_TIMEOUT_MS_FETCH);
 
         // should not be zero
         cons = new FetchingBusConsumerImpl(makeBuilder().fetchTimeout(0).build());
-        assertThat(cons.getSleepTime()).isEqualTo(PolicyEndPointProperties.DEFAULT_TIMEOUT_MS_FETCH);
+        assertThat(cons.getSleepTime()).isEqualTo(MessageBusProperties.DEFAULT_TIMEOUT_MS_FETCH);
 
         // should not be too large
         cons = new FetchingBusConsumerImpl(
-                        makeBuilder().fetchTimeout(PolicyEndPointProperties.DEFAULT_TIMEOUT_MS_FETCH + 100).build());
-        assertThat(cons.getSleepTime()).isEqualTo(PolicyEndPointProperties.DEFAULT_TIMEOUT_MS_FETCH);
+                        makeBuilder().fetchTimeout(MessageBusProperties.DEFAULT_TIMEOUT_MS_FETCH + 100).build());
+        assertThat(cons.getSleepTime()).isEqualTo(MessageBusProperties.DEFAULT_TIMEOUT_MS_FETCH);
 
         // should not be what was specified
         cons = new FetchingBusConsumerImpl(makeBuilder().fetchTimeout(100).build());
@@ -226,7 +224,7 @@ class BusConsumerTest extends TopicTestBase {
     }
 
     @Test
-    void testFetchWithMessagesAndTraceparent() {
+    void testFetchWithMessagesAndTraceParent() {
         // Setup
         KafkaConsumerWrapper kafkaConsumerWrapper = new KafkaConsumerWrapper(makeKafkaBuilder().build());
         kafkaConsumerWrapper.consumer = mockedKafkaConsumer;
@@ -1,7 +1,5 @@
 /*
  * ============LICENSE_START=======================================================
- * policy-endpoints
- * ================================================================================
  * Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
@@ -19,7 +17,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus.internal;
+package org.onap.policy.common.message.bus.event.base;
 
 import static org.assertj.core.api.Assertions.assertThatCode;
 import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -30,7 +28,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.onap.policy.common.endpoints.event.comm.bus.TopicTestBase;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
 import org.onap.policy.common.utils.gson.GsonTestUtils;
 
 class BusTopicBaseTest extends TopicTestBase {
@@ -1,7 +1,5 @@
 /*
  * ============LICENSE_START=======================================================
- * policy-endpoints
- * ================================================================================
  * Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
@@ -19,7 +17,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus;
+package org.onap.policy.common.message.bus.event.base;
 
 import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
 import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -29,17 +27,16 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertNotSame;
 import static org.junit.jupiter.api.Assertions.assertSame;
 import static org.junit.jupiter.api.Assertions.assertTrue;
-import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_ALLOW_SELF_SIGNED_CERTIFICATES_SUFFIX;
-import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_HTTP_HTTPS_SUFFIX;
-import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_MANAGED_SUFFIX;
-import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_TOPIC_EFFECTIVE_TOPIC_SUFFIX;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_ALLOW_SELF_SIGNED_CERTIFICATES_SUFFIX;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_HTTP_HTTPS_SUFFIX;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_MANAGED_SUFFIX;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_TOPIC_EFFECTIVE_TOPIC_SUFFIX;
 
-import java.util.Arrays;
 import java.util.List;
 import java.util.Properties;
 import java.util.function.Predicate;
-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.message.bus.event.Topic;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
 
 /**
  * Base class for Topic Factory tests that use BusTopicParams.
@@ -75,7 +72,7 @@ public abstract class BusTopicFactoryTestBase<T extends Topic> extends TopicFact
     /**
      * Tests building a topic using BusTopicParams.
      */
-    void testBuildBusTopicParams() {
+    public void testBuildBusTopicParams() {
         initFactory();
 
         // two unmanaged topics
@@ -112,7 +109,7 @@ public abstract class BusTopicFactoryTestBase<T extends Topic> extends TopicFact
     /**
      * Tests exception cases when building a topic using BusTopicParams.
      */
-    void testBuildBusTopicParams_Ex() {
+    public void testBuildBusTopicParams_Ex() {
         // null topic
         assertThatIllegalArgumentException().isThrownBy(() -> buildTopic(makeBuilder().topic(null).build()));
 
@@ -123,7 +120,7 @@ public abstract class BusTopicFactoryTestBase<T extends Topic> extends TopicFact
     /**
      * Tests building a topic using a list of servers and a topic.
      */
-    void testBuildListOfStringString() {
+    public void testBuildListOfStringString() {
         initFactory();
 
         T item1 = buildTopic(servers, MY_TOPIC);
@@ -133,8 +130,8 @@ public abstract class BusTopicFactoryTestBase<T extends Topic> extends TopicFact
         BusTopicParams params = getLastParams();
         assertEquals(servers, params.getServers());
         assertEquals(MY_TOPIC, params.getTopic());
-        assertEquals(true, params.isManaged());
-        assertEquals(false, params.isUseHttps());
+        assertTrue(params.isManaged());
+        assertFalse(params.isUseHttps());
 
         T item2 = buildTopic(servers, TOPIC2);
         assertNotNull(item2);
@@ -149,7 +146,7 @@ public abstract class BusTopicFactoryTestBase<T extends Topic> extends TopicFact
      * Tests building a topic using Properties. Verifies parameters specific to Bus
      * topics.
      */
-    void testBuildProperties() {
+    public void testBuildProperties() {
         initFactory();
 
         List<T> topics = buildTopics(makePropBuilder().makeTopic(MY_TOPIC).build());
@@ -158,12 +155,12 @@ public abstract class BusTopicFactoryTestBase<T extends Topic> extends TopicFact
         assertEquals(MY_EFFECTIVE_TOPIC, topics.get(0).getEffectiveTopic());
 
         BusTopicParams params = getLastParams();
-        assertEquals(true, params.isManaged());
-        assertEquals(true, params.isUseHttps());
-        assertEquals(true, params.isAllowSelfSignedCerts());
+        assertTrue(params.isManaged());
+        assertTrue(params.isUseHttps());
+        assertTrue(params.isAllowSelfSignedCerts());
         assertEquals(MY_API_KEY, params.getApiKey());
         assertEquals(MY_API_SECRET, params.getApiSecret());
-        assertEquals(Arrays.asList(SERVER), params.getServers());
+        assertEquals(List.of(SERVER), params.getServers());
         assertEquals(MY_TOPIC, params.getTopic());
         assertEquals(MY_EFFECTIVE_TOPIC, params.getEffectiveTopic());
 
@@ -223,7 +220,7 @@ public abstract class BusTopicFactoryTestBase<T extends Topic> extends TopicFact
      * @param builderName name of the builder property
      * @param addName name of the "additional" property
      */
-    protected void expectNullAddProp(String builderName, String addName) {
+    public void expectNullAddProp(String builderName, String addName) {
 
         // remove the property
         initFactory();
@@ -1,7 +1,5 @@
 /*
  * ============LICENSE_START=======================================================
- * policy-endpoints
- * ================================================================================
  * Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2024 Nordix Foundation.
  * ================================================================================
@@ -19,7 +17,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus.internal;
+package org.onap.policy.common.message.bus.event.base;
 
 import static org.assertj.core.api.Assertions.assertThatCode;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
@@ -38,9 +36,9 @@ import java.util.List;
 import org.junit.jupiter.api.AfterEach;
 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.TopicListener;
-import org.onap.policy.common.endpoints.event.comm.bus.TopicTestBase;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.event.TopicListener;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
 import org.onap.policy.common.utils.gson.GsonTestUtils;
 
 class InlineBusTopicSinkTest extends TopicTestBase {
@@ -1,7 +1,5 @@
 /*
  * ============LICENSE_START=======================================================
- * policy-endpoints
- * ================================================================================
  * Copyright (C) 2018-2021 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
@@ -19,7 +17,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus.internal;
+package org.onap.policy.common.message.bus.event.base;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatCode;
@@ -43,9 +41,9 @@ import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
-import org.onap.policy.common.endpoints.event.comm.TopicListener;
-import org.onap.policy.common.endpoints.event.comm.bus.TopicTestBase;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.event.TopicListener;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
 import org.onap.policy.common.utils.gson.GsonTestUtils;
 import org.onap.policy.common.utils.network.NetworkUtil;
 
@@ -19,7 +19,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus.internal;
+package org.onap.policy.common.message.bus.event.base;
 
 import static org.assertj.core.api.Assertions.assertThatCode;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
@@ -32,14 +32,12 @@ import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
 
-import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 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.TopicListener;
-import org.onap.policy.common.endpoints.event.comm.bus.TopicTestBase;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.event.TopicListener;
 import org.onap.policy.common.utils.gson.GsonTestUtils;
 
 class TopicBaseTest extends TopicTestBase {
@@ -109,16 +107,16 @@ class TopicBaseTest extends TopicTestBase {
     void testRegister() {
         TopicListener listener = mock(TopicListener.class);
         base.register(listener);
-        assertEquals(Arrays.asList(listener), base.snapshotTopicListeners());
+        assertEquals(List.of(listener), base.snapshotTopicListeners());
 
         // re-register - list should be unchanged
         base.register(listener);
-        assertEquals(Arrays.asList(listener), base.snapshotTopicListeners());
+        assertEquals(List.of(listener), base.snapshotTopicListeners());
 
         // register a new listener
         TopicListener listener2 = mock(TopicListener.class);
         base.register(listener2);
-        assertEquals(Arrays.asList(listener, listener2), base.snapshotTopicListeners());
+        assertEquals(List.of(listener, listener2), base.snapshotTopicListeners());
     }
 
     @Test
@@ -136,7 +134,7 @@ class TopicBaseTest extends TopicTestBase {
 
         // unregister one
         base.unregister(listener);
-        assertEquals(Arrays.asList(listener2), base.snapshotTopicListeners());
+        assertEquals(List.of(listener2), base.snapshotTopicListeners());
 
         // unregister the other
         base.unregister(listener2);
@@ -1,7 +1,5 @@
 /*
  * ============LICENSE_START=======================================================
- * policy-endpoints
- * ================================================================================
  * Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
@@ -19,7 +17,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus;
+package org.onap.policy.common.message.bus.event.base;
 
 import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
 import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
@@ -28,11 +26,11 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertNotSame;
 import static org.junit.jupiter.api.Assertions.assertSame;
 import static org.junit.jupiter.api.Assertions.assertTrue;
-import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_TOPIC_SERVERS_SUFFIX;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_TOPIC_SERVERS_SUFFIX;
 
 import java.util.List;
 import java.util.Properties;
-import org.onap.policy.common.endpoints.event.comm.Topic;
+import org.onap.policy.common.message.bus.event.Topic;
 
 /**
  * Base class for XxxTopicFactory tests.
@@ -107,22 +105,22 @@ public abstract class TopicFactoryTestBase<T extends Topic> extends TopicTestBas
 
         // null servers
         assertTrue(buildTopics(makePropBuilder().makeTopic(MY_TOPIC).removeTopicProperty(PROPERTY_TOPIC_SERVERS_SUFFIX)
-                        .build()).isEmpty());
+            .build()).isEmpty());
 
         // empty servers
         assertTrue(buildTopics(makePropBuilder().makeTopic(MY_TOPIC).setTopicProperty(PROPERTY_TOPIC_SERVERS_SUFFIX, "")
-                        .build()).isEmpty());
+            .build()).isEmpty());
     }
 
     /**
      * Tests building multiple topics using Properties.
      */
-    void testBuildProperties_Multiple() {
+    public void testBuildProperties_Multiple() {
         initFactory();
 
         // make two fully-defined topics, and add two duplicate topic names to the list
         TopicPropertyBuilder builder =
-                        makePropBuilder().makeTopic(MY_TOPIC).makeTopic(TOPIC2).addTopic(MY_TOPIC).addTopic(MY_TOPIC);
+            makePropBuilder().makeTopic(MY_TOPIC).makeTopic(TOPIC2).addTopic(MY_TOPIC).addTopic(MY_TOPIC);
 
         List<T> lst = buildTopics(builder.build());
         assertEquals(4, lst.size());
@@ -137,7 +135,7 @@ public abstract class TopicFactoryTestBase<T extends Topic> extends TopicTestBas
     /**
      * Tests destroy(topic), get(topic), and inventory() methods.
      */
-    void testDestroyString_testGet_testInventory() {
+    public void testDestroyString_testGet_testInventory() {
         initFactory();
 
         List<T> lst = buildTopics(makePropBuilder().makeTopic(MY_TOPIC).makeTopic(TOPIC2).build());
@@ -178,7 +176,7 @@ public abstract class TopicFactoryTestBase<T extends Topic> extends TopicTestBas
     /**
      * Tests exception cases with destroy(topic).
      */
-    void testDestroyString_Ex() {
+    public void testDestroyString_Ex() {
         // null topic
         assertThatIllegalArgumentException().as("null topic").isThrownBy(() -> destroyTopic(null));
 
@@ -189,7 +187,7 @@ public abstract class TopicFactoryTestBase<T extends Topic> extends TopicTestBas
     /**
      * Tests the destroy() method.
      */
-    void testDestroy() {
+    public void testDestroy() {
         initFactory();
 
         List<T> lst = buildTopics(makePropBuilder().makeTopic(MY_TOPIC).makeTopic(TOPIC2).build());
@@ -211,7 +209,7 @@ public abstract class TopicFactoryTestBase<T extends Topic> extends TopicTestBas
     /**
      * Tests exception cases with get(topic).
      */
-    void testGet_Ex() {
+    public void testGet_Ex() {
         // null topic
         assertThatIllegalArgumentException().as("null topic").isThrownBy(() -> getTopic(null));
 
@@ -3,6 +3,7 @@
  * ONAP Policy Engine - Common Modules
  * ================================================================================
  * Copyright (C) 2018 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.
@@ -18,7 +19,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus;
+package org.onap.policy.common.message.bus.event.base;
 
 import java.util.Properties;
 
@@ -1,7 +1,5 @@
 /*
  * ============LICENSE_START=======================================================
- * policy-endpoints
- * ================================================================================
  * Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2024 Nordix Foundation.
  * ================================================================================
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus;
+package org.onap.policy.common.message.bus.event.base;
 
 import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
-import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
-import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams.TopicParamsBuilder;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
+import org.onap.policy.common.parameters.topic.BusTopicParams.TopicParamsBuilder;
 
 /**
  * Base class for Topic Test classes.
@@ -56,10 +54,7 @@ public class TopicTestBase {
     public static final String MY_MESSAGE = "my-message";
     public static final String MY_PARTITION = "my-partition";
     public static final String MY_MESSAGE2 = "my-message-2";
-    public static final String MY_PARTITION2 = "my-partition-2";
 
-    public static final String ROUTE_PROP = "routeOffer";
-    public static final String MY_ROUTE = "my-route";
     public static final String MY_SERIALIZER = "org.apache.kafka.common.serialization.StringSerializer";
     public static final int KAFKA_PORT = 9092;
 
@@ -19,7 +19,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.client;
+package org.onap.policy.common.message.bus.event.client;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
@@ -51,12 +51,12 @@ import org.junit.jupiter.api.extension.ExtendWith;
 import org.mockito.ArgumentCaptor;
 import org.mockito.Mock;
 import org.mockito.junit.jupiter.MockitoExtension;
-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.endpoints.event.comm.TopicSource;
+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.onap.policy.common.message.bus.event.TopicSource;
 import org.onap.policy.common.utils.coder.Coder;
 import org.onap.policy.common.utils.coder.CoderException;
 import org.onap.policy.common.utils.coder.StandardCoder;
@@ -153,19 +153,19 @@ class BidirectionalTopicClientTest {
     @Test
     void testBidirectionalTopicClientExceptions() {
         assertThatThrownBy(() -> new BidirectionalTopicClient2("unknown-sink", SOURCE_TOPIC))
-                        .isInstanceOf(BidirectionalTopicClientException.class)
-                        .hasMessage("no sinks for topic: unknown-sink");
+            .isInstanceOf(BidirectionalTopicClientException.class)
+            .hasMessage("no sinks for topic: unknown-sink");
 
         assertThatThrownBy(() -> new BidirectionalTopicClient2(SINK_TOPIC, "unknown-source"))
-                        .isInstanceOf(BidirectionalTopicClientException.class)
-                        .hasMessage("no sources for topic: unknown-source");
+            .isInstanceOf(BidirectionalTopicClientException.class)
+            .hasMessage("no sources for topic: unknown-source");
 
         // too many sources
         when(endpoint.getTopicSources(Arrays.asList(SOURCE_TOPIC))).thenReturn(Arrays.asList(source, source));
 
         assertThatThrownBy(() -> new BidirectionalTopicClient2(SINK_TOPIC, SOURCE_TOPIC))
-                        .isInstanceOf(BidirectionalTopicClientException.class)
-                        .hasMessage("too many sources for topic: my-source-topic");
+            .isInstanceOf(BidirectionalTopicClientException.class)
+            .hasMessage("too many sources for topic: my-source-topic");
     }
 
     /**
@@ -296,7 +296,7 @@ class BidirectionalTopicClientTest {
      * Verifies that awaitReceipt() returns {@code true}.
      *
      * @throws InterruptedException if interrupted while waiting for the thread to
-     *         terminate
+     *                              terminate
      */
     private void verifyReceipt() throws InterruptedException {
         assertThat(context.join()).isTrue();
@@ -311,7 +311,7 @@ class BidirectionalTopicClientTest {
      * Verifies that awaitReceipt() returns {@code false}.
      *
      * @throws InterruptedException if interrupted while waiting for the thread to
-     *         terminate
+     *                              terminate
      */
     private void verifyNoReceipt() throws InterruptedException {
         assertThat(context.join()).isTrue();
@@ -351,7 +351,7 @@ class BidirectionalTopicClientTest {
     private class BidirectionalTopicClient2 extends BidirectionalTopicClient {
 
         public BidirectionalTopicClient2(String sinkTopic, String sourceTopic)
-                        throws BidirectionalTopicClientException {
+            throws BidirectionalTopicClientException {
             super(sinkTopic, sourceTopic);
         }
 
@@ -19,7 +19,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.client;
+package org.onap.policy.common.message.bus.event.client;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -38,8 +38,8 @@ import java.util.concurrent.atomic.AtomicReference;
 import org.junit.jupiter.api.AfterAll;
 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.event.comm.TopicSink;
+import org.onap.policy.common.message.bus.event.TopicEndpointManager;
+import org.onap.policy.common.message.bus.event.TopicSink;
 
 class TopicSinkClientTest {
     private static final String TOPIC = "my-topic";
@@ -101,7 +101,7 @@ class TopicSinkClientTest {
         // unknown topic -> should throw exception
         sinks = new LinkedList<>();
         assertThatThrownBy(() -> new TopicSinkClient2(TOPIC)).isInstanceOf(TopicSinkClientException.class)
-                .hasMessage("no sinks for topic: my-topic");
+            .hasMessage("no sinks for topic: my-topic");
     }
 
     @Test
@@ -109,9 +109,10 @@ class TopicSinkClientTest {
         assertEquals(TOPIC, new TopicSinkClient(TopicEndpointManager.getManager().getNoopTopicSink(TOPIC)).getTopic());
         assertEquals(TOPIC, new TopicSinkClient(TOPIC).getTopic());
 
-        assertThatThrownBy(() -> new TopicSinkClient((TopicSink) null)).isInstanceOf(IllegalArgumentException.class);
+        assertThatThrownBy(() -> new TopicSinkClient((TopicSink) null))
+            .hasMessageContaining("sink is marked non-null but is null");
         assertThatThrownBy(() -> new TopicSinkClient("blah")).isInstanceOf(TopicSinkClientException.class)
-                            .hasMessage("no sinks for topic: blah");
+            .hasMessage("no sinks for topic: blah");
     }
 
     @Test
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus;
+package org.onap.policy.common.message.bus.event.kafka;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
 import java.util.List;
-import org.apache.kafka.clients.ClientUtils;
 import org.junit.jupiter.api.Test;
-import org.mockito.Mock;
-import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
 
 class IndexedKafkaTopicSourceFactoryTest {
 
     private IndexedKafkaTopicSourceFactory factory;
 
-    @Mock
-    ClientUtils mockClientUtils;
-
     @Test
     void testBuild() {
         factory = new IndexedKafkaTopicSourceFactory();
@@ -64,11 +59,5 @@ class IndexedKafkaTopicSourceFactoryTest {
         assertThatThrownBy(() -> factory.build(params))
             .isInstanceOf(IllegalArgumentException.class)
             .hasMessageContaining("A topic must be provided");
-
-        params.setTopic("topic01");
-
-        assertThatThrownBy(() -> factory.build(servers, "topic1"))
-            .isInstanceOf(IllegalArgumentException.class)
-            .hasMessageContaining("cannot create topic");
     }
 }
@@ -1,7 +1,5 @@
 /*
  * ============LICENSE_START=======================================================
- * policy-endpoints
- * ================================================================================
  * Copyright (C) 2022-2024 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,7 +16,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus.internal;
+package org.onap.policy.common.message.bus.event.kafka;
 
 import static org.assertj.core.api.Assertions.assertThatCode;
 import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -27,8 +25,8 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
 import org.junit.jupiter.api.AfterEach;
 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.bus.TopicTestBase;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.event.base.TopicTestBase;
 
 class InlineKafkaTopicSinkTest extends TopicTestBase {
     private InlineKafkaTopicSink sink;
@@ -16,7 +16,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus.internal;
+package org.onap.policy.common.message.bus.event.kafka;
 
 import static org.assertj.core.api.Assertions.assertThatCode;
 import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -34,10 +34,11 @@ import org.apache.kafka.clients.producer.ProducerRecord;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.mockito.ArgumentMatchers;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
 
 class KafkaPublisherWrapperTest {
 
-    private BusPublisher.KafkaPublisherWrapper kafkaPublisherWrapper;
+    private KafkaPublisherWrapper kafkaPublisherWrapper;
     private Producer<String, String> mockProducer;
     private BusTopicParams mockBusTopicParams;
 
@@ -52,8 +53,8 @@ class KafkaPublisherWrapperTest {
         when(mockBusTopicParams.isAdditionalPropsValid()).thenReturn(false);
         when(mockBusTopicParams.isAllowTracing()).thenReturn(false);
 
-        kafkaPublisherWrapper = new BusPublisher.KafkaPublisherWrapper(mockBusTopicParams) {
-            protected Producer<String, String> createProducer(Properties props) { // NOSONAR instance creation
+        kafkaPublisherWrapper = new KafkaPublisherWrapper(mockBusTopicParams) {
+            private Producer<String, String> createProducer(Properties props) { // NOSONAR instance creation
                 return mockProducer;
             }
         };
@@ -1,7 +1,5 @@
 /*
  * ============LICENSE_START=======================================================
- * policy-endpoints
- * ================================================================================
  * Copyright (C) 2022-2024 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus;
+package org.onap.policy.common.message.bus.event.kafka;
 
 import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
 
 import java.util.Collections;
-import org.onap.policy.common.endpoints.event.comm.Topic;
+import org.onap.policy.common.message.bus.event.Topic;
+import org.onap.policy.common.message.bus.event.base.BusTopicFactoryTestBase;
 
 /**
  * Base class for KafkaTopicXxxFactory tests.
@@ -33,7 +32,7 @@ import org.onap.policy.common.endpoints.event.comm.Topic;
 public abstract class KafkaTopicFactoryTestBase<T extends Topic> extends BusTopicFactoryTestBase<T> {
 
     @Override
-    void testBuildBusTopicParams_Ex() {
+    public void testBuildBusTopicParams_Ex() {
 
         super.testBuildBusTopicParams_Ex();
 
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus;
+package org.onap.policy.common.message.bus.event.kafka;
 
-import static org.onap.policy.common.endpoints.event.comm.bus.TopicTestBase.MY_EFFECTIVE_TOPIC;
-import static org.onap.policy.common.endpoints.event.comm.bus.TopicTestBase.MY_PARTITION;
-import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_HTTP_HTTPS_SUFFIX;
-import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_MANAGED_SUFFIX;
-import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_TOPIC_EFFECTIVE_TOPIC_SUFFIX;
-import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_TOPIC_SERVERS_SUFFIX;
-import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_TOPIC_SINK_PARTITION_KEY_SUFFIX;
+import static org.onap.policy.common.message.bus.event.base.TopicTestBase.MY_EFFECTIVE_TOPIC;
+import static org.onap.policy.common.message.bus.event.base.TopicTestBase.MY_PARTITION;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_HTTP_HTTPS_SUFFIX;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_MANAGED_SUFFIX;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_TOPIC_EFFECTIVE_TOPIC_SUFFIX;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_TOPIC_SERVERS_SUFFIX;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_TOPIC_SINK_PARTITION_KEY_SUFFIX;
 
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
@@ -32,7 +32,8 @@ import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import lombok.Getter;
-import org.onap.policy.common.endpoints.parameters.TopicParameters;
+import org.onap.policy.common.message.bus.event.base.TopicPropertyBuilder;
+import org.onap.policy.common.parameters.topic.TopicParameters;
 
 @Getter
 public class KafkaTopicPropertyBuilder extends TopicPropertyBuilder {
@@ -1,7 +1,5 @@
 /*
  * ============LICENSE_START=======================================================
- * policy-endpoints
- * ================================================================================
  * Copyright (C) 2022, 2024 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus;
+package org.onap.policy.common.message.bus.event.kafka;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
-import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_KAFKA_SINK_TOPICS;
-import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_TOPIC_EFFECTIVE_TOPIC_SUFFIX;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_KAFKA_SINK_TOPICS;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_TOPIC_EFFECTIVE_TOPIC_SUFFIX;
 
 import java.util.Deque;
 import java.util.LinkedList;
@@ -34,7 +32,8 @@ import java.util.Properties;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
+import org.onap.policy.common.message.bus.event.base.TopicPropertyBuilder;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
 
 class KafkaTopicSinkFactoryTest extends KafkaTopicFactoryTestBase<KafkaTopicSink> {
 
@@ -59,14 +58,14 @@ class KafkaTopicSinkFactoryTest extends KafkaTopicFactoryTestBase<KafkaTopicSink
 
     @Test
     @Override
-    void testBuildBusTopicParams() {
+    public void testBuildBusTopicParams() {
         super.testBuildBusTopicParams();
         super.testBuildBusTopicParams_Ex();
     }
 
     @Test
     @Override
-    void testBuildListOfStringString() {
+    public void testBuildListOfStringString() {
         super.testBuildListOfStringString();
 
         // check parameters that were used
@@ -76,7 +75,7 @@ class KafkaTopicSinkFactoryTest extends KafkaTopicFactoryTestBase<KafkaTopicSink
 
     @Test
     @Override
-    void testBuildProperties() {
+    public void testBuildProperties() {
         List<KafkaTopicSink> topics = buildTopics(makePropBuilder().makeTopic(MY_TOPIC).build());
         assertEquals(1, topics.size());
         assertEquals(MY_TOPIC, topics.get(0).getTopic());
@@ -111,14 +110,14 @@ class KafkaTopicSinkFactoryTest extends KafkaTopicFactoryTestBase<KafkaTopicSink
 
     @Test
     @Override
-    void testDestroyString_testGet_testInventory() {
+    public void testDestroyString_testGet_testInventory() {
         super.testDestroyString_testGet_testInventory();
         super.testDestroyString_Ex();
     }
 
     @Test
     @Override
-    void testDestroy() {
+    public void testDestroy() {
         super.testDestroy();
     }
 
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus;
+package org.onap.policy.common.message.bus.event.kafka;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertTrue;
-import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_KAFKA_SOURCE_TOPICS;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_KAFKA_SOURCE_TOPICS;
 
 import java.util.Deque;
 import java.util.LinkedList;
@@ -32,7 +32,8 @@ import java.util.Properties;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
-import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
+import org.onap.policy.common.message.bus.event.base.TopicPropertyBuilder;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
 
 class KafkaTopicSourceFactoryTest extends KafkaTopicFactoryTestBase<KafkaTopicSource> {
 
@@ -58,7 +59,7 @@ class KafkaTopicSourceFactoryTest extends KafkaTopicFactoryTestBase<KafkaTopicSo
 
     @Test
     @Override
-    void testBuildProperties() {
+    public void testBuildProperties() {
 
         initFactory();
 
@@ -77,14 +78,14 @@ class KafkaTopicSourceFactoryTest extends KafkaTopicFactoryTestBase<KafkaTopicSo
 
     @Test
     @Override
-    void testDestroyString_testGet_testInventory() {
+    public void testDestroyString_testGet_testInventory() {
         super.testDestroyString_testGet_testInventory();
         super.testDestroyString_Ex();
     }
 
     @Test
     @Override
-    void testDestroy() {
+    public void testDestroy() {
         super.testDestroy();
     }
 
@@ -156,7 +157,7 @@ class KafkaTopicSourceFactoryTest extends KafkaTopicFactoryTestBase<KafkaTopicSo
      * Factory that records the parameters of all the sources it creates.
      */
     private static class SourceFactory extends IndexedKafkaTopicSourceFactory {
-        private Deque<BusTopicParams> params = new LinkedList<>();
+        private final Deque<BusTopicParams> params = new LinkedList<>();
 
         @Override
         protected KafkaTopicSource makeSource(BusTopicParams busTopicParams) {
@@ -1,7 +1,5 @@
 /*
  * ============LICENSE_START=======================================================
- * policy-endpoints
- * ================================================================================
  * Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus.internal;
+package org.onap.policy.common.message.bus.event.kafka;
 
-import static org.assertj.core.api.Assertions.assertThatCode;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import org.junit.jupiter.api.AfterEach;
 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.bus.TopicTestBase;
-import org.onap.policy.common.utils.gson.GsonTestUtils;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.event.base.TopicTestBase;
 
 class SingleThreadedKafkaTopicSourceTest extends TopicTestBase {
     private SingleThreadedKafkaTopicSource source;
@@ -51,11 +47,6 @@ class SingleThreadedKafkaTopicSourceTest extends TopicTestBase {
         source.shutdown();
     }
 
-    void testSerialize() {
-        assertThatCode(() -> new GsonTestUtils().compareGson(source, SingleThreadedKafkaTopicSourceTest.class))
-                        .doesNotThrowAnyException();
-    }
-
     @Test
     void testToString() {
         assertTrue(source.toString().startsWith("SingleThreadedKafkaTopicSource ["));
@@ -19,7 +19,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus;
+package org.onap.policy.common.message.bus.event.noop;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -33,8 +33,9 @@ import java.util.Arrays;
 import java.util.Collections;
 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.TopicListener;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.event.TopicListener;
+import org.onap.policy.common.message.bus.event.base.TopicTestBase;
 
 public abstract class NoopTopicEndpointTest<F extends NoopTopicFactory<T>, T extends NoopTopicEndpoint>
     extends TopicTestBase {
@@ -19,7 +19,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus;
+package org.onap.policy.common.message.bus.event.noop;
 
 import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
@@ -28,11 +28,10 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertNotSame;
 import static org.junit.jupiter.api.Assertions.assertSame;
 import static org.junit.jupiter.api.Assertions.assertTrue;
-import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_MANAGED_SUFFIX;
-import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_TOPIC_SERVERS_SUFFIX;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_MANAGED_SUFFIX;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_TOPIC_SERVERS_SUFFIX;
 
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 import java.util.Properties;
@@ -40,13 +39,16 @@ import org.apache.commons.lang3.RandomStringUtils;
 import org.junit.jupiter.api.AfterEach;
 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.bus.internal.BusTopicParams;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.event.base.TopicFactoryTestBase;
+import org.onap.policy.common.message.bus.event.base.TopicPropertyBuilder;
+import org.onap.policy.common.message.bus.event.base.TopicTestBase;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
 
 public abstract class NoopTopicFactoryTest<F extends NoopTopicFactory<T>, T extends NoopTopicEndpoint>
     extends TopicFactoryTestBase<T> {
 
-    private static final List<String> NOOP_SERVERS = Arrays.asList(CommInfrastructure.NOOP.toString());
+    private static final List<String> NOOP_SERVERS = List.of(CommInfrastructure.NOOP.toString());
     private F factory = null;
 
     protected abstract F buildFactory();
@@ -70,7 +72,7 @@ public abstract class NoopTopicFactoryTest<F extends NoopTopicFactory<T>, T exte
     void testBuildBusTopicParams() {
         initFactory();
 
-        T item1 = buildTopic(makeParams(servers, MY_TOPIC, true));
+        T item1 = buildTopic(makeParams(servers));
         assertNotNull(item1);
 
         assertEquals(servers, item1.getServers());
@@ -180,14 +182,14 @@ public abstract class NoopTopicFactoryTest<F extends NoopTopicFactory<T>, T exte
 
     @Test
     @Override
-    void testDestroyString_testGet_testInventory() {
+    public void testDestroyString_testGet_testInventory() {
         super.testDestroyString_testGet_testInventory();
         super.testDestroyString_Ex();
     }
 
     @Test
     @Override
-    void testDestroy() {
+    public void testDestroy() {
         super.testDestroy();
     }
 
@@ -243,12 +245,12 @@ public abstract class NoopTopicFactoryTest<F extends NoopTopicFactory<T>, T exte
         return new NoopTopicPropertyBuilder(factory.getTopicsPropertyName());
     }
 
-    private BusTopicParams makeParams(List<String> servers, String topic, boolean managed) {
+    private BusTopicParams makeParams(List<String> servers) {
         BusTopicParams params = new BusTopicParams();
 
         params.setServers(servers);
-        params.setTopic(topic);
-        params.setManaged(managed);
+        params.setTopic(TopicTestBase.MY_TOPIC);
+        params.setManaged(true);
 
         return params;
     }
@@ -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.
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus;
+package org.onap.policy.common.message.bus.event.noop;
 
-import static org.onap.policy.common.endpoints.event.comm.bus.TopicTestBase.MY_EFFECTIVE_TOPIC;
-import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_ALLOW_SELF_SIGNED_CERTIFICATES_SUFFIX;
-import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_HTTP_HTTPS_SUFFIX;
-import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_MANAGED_SUFFIX;
-import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_TOPIC_EFFECTIVE_TOPIC_SUFFIX;
-import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_TOPIC_SERVERS_SUFFIX;
+import static org.onap.policy.common.message.bus.event.base.TopicTestBase.MY_EFFECTIVE_TOPIC;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_ALLOW_SELF_SIGNED_CERTIFICATES_SUFFIX;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_HTTP_HTTPS_SUFFIX;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_MANAGED_SUFFIX;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_TOPIC_EFFECTIVE_TOPIC_SUFFIX;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_TOPIC_SERVERS_SUFFIX;
 
-import java.util.Arrays;
+import java.util.List;
 import lombok.Getter;
-import org.onap.policy.common.endpoints.parameters.TopicParameters;
+import org.onap.policy.common.message.bus.event.base.TopicPropertyBuilder;
+import org.onap.policy.common.parameters.topic.TopicParameters;
 
+@Getter
 public class NoopTopicPropertyBuilder extends TopicPropertyBuilder {
 
     public static final String SERVER = "my-server";
-    public static final String TOPIC2 = "my-topic-2";
 
-    @Getter
-    private TopicParameters params = new TopicParameters();
+    private final TopicParameters params = new TopicParameters();
 
     /**
      * Constructs the object.
@@ -69,7 +70,7 @@ public class NoopTopicPropertyBuilder extends TopicPropertyBuilder {
         params.setManaged(true);
         params.setUseHttps(true);
         params.setAllowSelfSignedCerts(true);
-        params.setServers(Arrays.asList(SERVER));
+        params.setServers(List.of(SERVER));
 
         return this;
     }
@@ -19,7 +19,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus;
+package org.onap.policy.common.message.bus.event.noop;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.jupiter.api.Assertions.assertFalse;
@@ -1,7 +1,5 @@
 /*
  * ============LICENSE_START=======================================================
- * policy-endpoints
- * ================================================================================
  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
@@ -19,7 +17,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.event.comm.bus;
+package org.onap.policy.common.message.bus.event.noop;
 
 import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -16,7 +16,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.features;
+package org.onap.policy.common.message.bus.features;
 
 import static org.junit.jupiter.api.Assertions.assertFalse;
 
@@ -25,8 +25,8 @@ import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.ExtendWith;
 import org.mockito.Mock;
 import org.mockito.junit.jupiter.MockitoExtension;
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
-import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.utils.NetLoggerUtil.EventType;
 import org.slf4j.Logger;
 
 @ExtendWith(MockitoExtension.class)
@@ -1,7 +1,5 @@
 /*-
  * ============LICENSE_START=======================================================
- * policy-endpoints
- * ================================================================================
  * Copyright (C) 2024 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.utils;
+package org.onap.policy.common.message.bus.utils;
 
-import static org.onap.policy.common.endpoints.properties.PolicyEndPointProperties.PROPERTY_ADDITIONAL_PROPS_SUFFIX;
+import static org.onap.policy.common.message.bus.properties.MessageBusProperties.PROPERTY_ADDITIONAL_PROPS_SUFFIX;
 
 import java.util.Properties;
 import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
+import org.onap.policy.common.utils.properties.PropertyUtils;
 
 class KafkaPropertyUtilsTest {
 
@@ -1,7 +1,5 @@
 /*-
  * ============LICENSE_START=======================================================
- * policy-endpoints
- * ================================================================================
  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2024 Nordix Foundation
  * ================================================================================
@@ -19,7 +17,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.utils;
+package org.onap.policy.common.message.bus.utils;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 
@@ -30,10 +28,10 @@ import java.util.List;
 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.features.NetLoggerFeatureApi;
-import org.onap.policy.common.endpoints.features.NetLoggerFeatureProviders;
-import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.features.NetLoggerFeatureApi;
+import org.onap.policy.common.message.bus.features.NetLoggerFeatureProviders;
+import org.onap.policy.common.message.bus.utils.NetLoggerUtil.EventType;
 import org.slf4j.Logger;
 
 /**
@@ -205,7 +203,7 @@ class NetLoggerUtilTest {
          * Sets the return value for the before/after hooks.
          *
          * @param beforeVal beforeLog() return value
-         * @param afterVal afterLog() return value
+         * @param afterVal  afterLog() return value
          */
         public void setReturnValue(boolean beforeVal, boolean afterVal) {
             this.beforeReturn = beforeVal;
@@ -239,7 +237,7 @@ class NetLoggerUtilTest {
          */
         @Override
         public boolean beforeLog(Logger eventLogger, EventType type, CommInfrastructure protocol, String topic,
-                        String message) {
+                                 String message) {
 
             if (beforeException) {
                 throw new RuntimeException("beforeLog exception");
@@ -255,7 +253,7 @@ class NetLoggerUtilTest {
          */
         @Override
         public boolean afterLog(Logger eventLogger, EventType type, CommInfrastructure protocol, String topic,
-                        String message) {
+                                String message) {
 
             if (afterException) {
                 throw new RuntimeException("afterLog exception");
diff --git a/message-bus/src/test/resources/META-INF/services/org.onap.policy.common.message.bus.features.NetLoggerFeatureApi b/message-bus/src/test/resources/META-INF/services/org.onap.policy.common.message.bus.features.NetLoggerFeatureApi
new file mode 100644 (file)
index 0000000..7889cb8
--- /dev/null
@@ -0,0 +1 @@
+org.onap.policy.common.message.bus.utils.NetLoggerUtilTest$NetLoggerFeature
\ No newline at end of file
diff --git a/message-bus/src/test/resources/logback-test.xml b/message-bus/src/test/resources/logback-test.xml
new file mode 100644 (file)
index 0000000..ddf4f8b
--- /dev/null
@@ -0,0 +1,42 @@
+<!--
+  ============LICENSE_START=======================================================
+  ONAP
+  ================================================================================
+  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.
+  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  ============LICENSE_END=========================================================
+  -->
+<configuration>
+
+    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+            <Pattern>
+                %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36}.%M\(%line\) - %msg%n
+            </Pattern>
+        </encoder>
+    </appender>
+
+    <appender name="testAppender" class="org.onap.policy.common.message.bus.utils.NetLoggerUtilTest$TestAppender"/>
+
+    <logger name="org.onap.policy.drools.http.server.test" level="INFO"/>
+
+    <logger name="network" level="INFO">
+        <appender-ref ref="testAppender"/>
+    </logger>
+
+    <root level="WARN">
+        <appender-ref ref="STDOUT"/>
+    </root>
+
+</configuration>
\ No newline at end of file
index cacd36c..4afcf02 100644 (file)
             <groupId>org.onap.policy.common</groupId>
             <artifactId>capabilities</artifactId>
             <version>${project.version}</version>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.onap.policy.common</groupId>
-            <artifactId>gson</artifactId>
+            <artifactId>common-parameters</artifactId>
             <version>${project.version}</version>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.onap.policy.common</groupId>
-            <artifactId>utils</artifactId>
+            <artifactId>gson</artifactId>
             <version>${project.version}</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.onap.policy.common</groupId>
-            <artifactId>common-parameters</artifactId>
+            <artifactId>message-bus</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>
             <groupId>org.onap.policy.common</groupId>
-            <artifactId>utils-test</artifactId>
+            <artifactId>utils</artifactId>
             <version>${project.version}</version>
-            <scope>test</scope>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>com.google.guava</groupId>
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>org.glassfish.jaxb</groupId>
-            <artifactId>jaxb-runtime</artifactId>
+            <groupId>com.google.re2j</groupId>
+            <artifactId>re2j</artifactId>
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>org.glassfish.jersey.containers</groupId>
-            <artifactId>jersey-container-servlet-core</artifactId>
+            <groupId>io.prometheus</groupId>
+            <artifactId>simpleclient_hotspot</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.glassfish.jersey.core</groupId>
-            <artifactId>jersey-server</artifactId>
-            <version>${version.jersey}</version>
+            <groupId>io.prometheus</groupId>
+            <artifactId>simpleclient_servlet_jakarta</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.glassfish.jersey.inject</groupId>
-            <artifactId>jersey-hk2</artifactId>
-            <version>${version.jersey}</version>
+            <groupId>jakarta.ws.rs</groupId>
+            <artifactId>jakarta.ws.rs-api</artifactId>
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>org.eclipse.jetty</groupId>
-            <artifactId>jetty-servlet</artifactId>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.eclipse.jetty</groupId>
             <artifactId>jetty-server</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.apache.kafka</groupId>
-            <artifactId>kafka-clients</artifactId>
+            <groupId>org.eclipse.jetty</groupId>
+            <artifactId>jetty-servlet</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.jetty</groupId>
+            <artifactId>jetty-util</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.jetty.toolchain</groupId>
+            <artifactId>jetty-jakarta-servlet-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.glassfish.jersey.containers</groupId>
+            <artifactId>jersey-container-servlet-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.glassfish.jersey.core</groupId>
+            <artifactId>jersey-client</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.glassfish.jersey.core</groupId>
+            <artifactId>jersey-server</artifactId>
+            <version>${version.jersey}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-collections4</artifactId>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-jexl3</artifactId>
+            <groupId>org.yaml</groupId>
+            <artifactId>snakeyaml</artifactId>
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>io.swagger.core.v3</groupId>
-            <artifactId>swagger-annotations</artifactId>
-            <scope>test</scope>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>io.opentelemetry.instrumentation</groupId>
-            <artifactId>opentelemetry-kafka-clients-2.6</artifactId>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-core</artifactId>
+            <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>io.swagger.core.v3</groupId>
-            <artifactId>swagger-jaxrs2-jakarta</artifactId>
+            <groupId>org.glassfish.jaxb</groupId>
+            <artifactId>jaxb-runtime</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.glassfish.jersey.inject</groupId>
+            <artifactId>jersey-hk2</artifactId>
+            <version>${version.jersey}</version>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>io.swagger.core.v3</groupId>
-            <artifactId>swagger-jaxrs2-servlet-initializer-v2-jakarta</artifactId>
+            <artifactId>swagger-annotations</artifactId>
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>io.prometheus</groupId>
-            <artifactId>simpleclient_hotspot</artifactId>
+            <groupId>io.swagger.core.v3</groupId>
+            <artifactId>swagger-jaxrs2-jakarta</artifactId>
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>io.prometheus</groupId>
-            <artifactId>simpleclient_servlet_jakarta</artifactId>
-            <scope>provided</scope>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>utils-test</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.assertj</groupId>
         </dependency>
         <dependency>
             <groupId>org.mockito</groupId>
-            <artifactId>mockito-junit-jupiter</artifactId>
+            <artifactId>mockito-core</artifactId>
             <scope>test</scope>
         </dependency>
         <dependency>
diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusPublisher.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusPublisher.java
deleted file mode 100644 (file)
index 1b57e48..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * policy-endpoints
- * ================================================================================
- * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2018 Samsung Electronics Co., Ltd.
- * Modifications Copyright (C) 2020,2023 Bell Canada. All rights reserved.
- * 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.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.common.endpoints.event.comm.bus.internal;
-
-import io.opentelemetry.instrumentation.kafkaclients.v2_6.TracingProducerInterceptor;
-import java.util.Properties;
-import java.util.UUID;
-import org.apache.kafka.clients.producer.KafkaProducer;
-import org.apache.kafka.clients.producer.Producer;
-import org.apache.kafka.clients.producer.ProducerConfig;
-import org.apache.kafka.clients.producer.ProducerRecord;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public interface BusPublisher {
-
-    String NO_MESSAGE_PROVIDED = "No message provided";
-    String LOG_CLOSE = "{}: CLOSE";
-    String LOG_CLOSE_FAILED = "{}: CLOSE FAILED";
-
-    /**
-     * sends a message.
-     *
-     * @param partitionId id
-     * @param message the message
-     * @return true if success, false otherwise
-     * @throws IllegalArgumentException if no message provided
-     */
-    boolean send(String partitionId, String message);
-
-    /**
-     * closes the publisher.
-     */
-    void close();
-
-    /**
-     * Kafka based library publisher.
-     */
-    class KafkaPublisherWrapper implements BusPublisher {
-
-        private static final Logger logger = LoggerFactory.getLogger(KafkaPublisherWrapper.class);
-        private static final String KEY_SERIALIZER = "org.apache.kafka.common.serialization.StringSerializer";
-
-        private final String topic;
-
-        /**
-         * Kafka publisher.
-         */
-        private final Producer<String, String> producer;
-        protected Properties kafkaProps;
-
-        /**
-         * Kafka Publisher Wrapper.
-         *
-         * @param busTopicParams topic parameters
-         */
-        protected KafkaPublisherWrapper(BusTopicParams busTopicParams) {
-
-            if (busTopicParams.isTopicInvalid()) {
-                throw new IllegalArgumentException("No topic for Kafka");
-            }
-
-            this.topic = busTopicParams.getTopic();
-
-            // Setup Properties for consumer
-            kafkaProps = new Properties();
-            kafkaProps.setProperty(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, busTopicParams.getServers().get(0));
-            if (busTopicParams.isAdditionalPropsValid()) {
-                kafkaProps.putAll(busTopicParams.getAdditionalProps());
-            }
-            if (kafkaProps.get(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG) == null) {
-                kafkaProps.setProperty(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, KEY_SERIALIZER);
-            }
-            if (kafkaProps.get(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG) == null) {
-                kafkaProps.setProperty(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, KEY_SERIALIZER);
-            }
-
-            if (busTopicParams.isAllowTracing()) {
-                kafkaProps.setProperty(ProducerConfig.INTERCEPTOR_CLASSES_CONFIG,
-                        TracingProducerInterceptor.class.getName());
-            }
-
-            producer = new KafkaProducer<>(kafkaProps);
-        }
-
-        @Override
-        public boolean send(String partitionId, String message) {
-            if (message == null) {
-                throw new IllegalArgumentException(NO_MESSAGE_PROVIDED);
-            }
-
-            try {
-                // Create the record
-                ProducerRecord<String, String> producerRecord =
-                        new ProducerRecord<>(topic, UUID.randomUUID().toString(), message);
-
-                this.producer.send(producerRecord);
-                producer.flush();
-            } catch (Exception e) {
-                logger.warn("{}: SEND of {} cannot be performed because of {}", this, message, e.getMessage(), e);
-                return false;
-            }
-            return true;
-        }
-
-        @Override
-        public void close() {
-            logger.info(LOG_CLOSE, this);
-
-            try {
-                this.producer.close();
-            } catch (Exception e) {
-                logger.warn("{}: CLOSE FAILED because of {}", this, e.getMessage(), e);
-            }
-        }
-
-        @Override
-        public String toString() {
-            return "KafkaPublisherWrapper []";
-        }
-
-    }
-}
index b155f72..0c76d5f 100644 (file)
@@ -4,6 +4,7 @@
  * ================================================================================
  * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2018 Samsung Electronics Co., Ltd.
+ * 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.
@@ -23,7 +24,7 @@ package org.onap.policy.common.endpoints.http.client;
 
 import java.util.List;
 import java.util.Properties;
-import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
 
 /**
  * Http Client Factory.
index 5f0b1d6..16d1a26 100644 (file)
@@ -3,7 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 2017-2019, 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.
@@ -29,10 +29,10 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Properties;
 import org.apache.commons.lang3.StringUtils;
-import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
 import org.onap.policy.common.endpoints.http.client.internal.JerseyClient;
 import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
-import org.onap.policy.common.endpoints.utils.PropertyUtils;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
+import org.onap.policy.common.utils.properties.PropertyUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index 130b6c1..d708d7c 100644 (file)
@@ -4,7 +4,7 @@
  * ================================================================================
  * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2018 Samsung Electronics Co., Ltd.
- * Modifications Copyright (C) 2019, 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2019, 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.
@@ -43,8 +43,8 @@ import lombok.ToString;
 import org.apache.commons.lang3.StringUtils;
 import org.glassfish.jersey.client.ClientProperties;
 import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;
-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.parameters.topic.BusTopicParams;
 import org.onap.policy.common.utils.network.NetworkUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
index 7c9aca4..a67c47f 100644 (file)
@@ -31,7 +31,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.onap.policy.common.endpoints.http.server.internal.JettyJerseyServer;
 import org.onap.policy.common.endpoints.http.server.internal.JettyStaticResourceServer;
 import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
-import org.onap.policy.common.endpoints.utils.PropertyUtils;
+import org.onap.policy.common.utils.properties.PropertyUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index 7e6ce86..10acc17 100644 (file)
@@ -29,9 +29,9 @@ import java.util.Optional;
 import java.util.Properties;
 import java.util.stream.Collectors;
 import lombok.ToString;
-import org.onap.policy.common.endpoints.parameters.RestServerParameters;
 import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
 import org.onap.policy.common.gson.GsonMessageBodyHandler;
+import org.onap.policy.common.parameters.rest.RestServerParameters;
 import org.onap.policy.common.utils.services.ServiceManagerContainer;
 
 /**
index 2e17107..90c8338 100644 (file)
@@ -4,6 +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) 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.
@@ -23,8 +24,8 @@ package org.onap.policy.common.endpoints.listeners;
 
 import lombok.AccessLevel;
 import lombok.NoArgsConstructor;
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
-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.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;
index 41f9abd..6639b41 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * 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.
@@ -21,7 +22,7 @@
 package org.onap.policy.common.endpoints.listeners;
 
 import java.util.concurrent.ConcurrentHashMap;
-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.coder.StandardCoderObject;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
index e575e33..368fd42 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * 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.
@@ -23,7 +24,7 @@ package org.onap.policy.common.endpoints.listeners;
 import com.google.common.base.Strings;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentLinkedQueue;
-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.coder.StandardCoderObject;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
index dc6ff12..bdb30eb 100644 (file)
@@ -4,6 +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) 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.
@@ -23,7 +24,7 @@ package org.onap.policy.common.endpoints.listeners;
 
 import lombok.AccessLevel;
 import lombok.AllArgsConstructor;
-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.coder.Coder;
 import org.onap.policy.common.utils.coder.CoderException;
 import org.onap.policy.common.utils.coder.StandardCoder;
index eea1622..a879db0 100644 (file)
@@ -3,6 +3,7 @@
  * ONAP
  * ================================================================================
  * Copyright (C) 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.common.endpoints.listeners;
 
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
 
 /**
  * Listener for messages of a certain type.
index 5d36a31..bfb29bd 100644 (file)
@@ -29,34 +29,9 @@ public final class PolicyEndPointProperties {
 
     /* Generic property suffixes */
 
-    public static final String PROPERTY_TOPIC_SERVERS_SUFFIX = ".servers";
-    public static final String PROPERTY_TOPIC_TOPICS_SUFFIX = ".topics";
-    public static final String PROPERTY_TOPIC_API_KEY_SUFFIX = ".apiKey";
-    public static final String PROPERTY_TOPIC_API_SECRET_SUFFIX = ".apiSecret";
-    public static final String PROPERTY_TOPIC_EFFECTIVE_TOPIC_SUFFIX = ".effectiveTopic";
-    public static final String PROPERTY_TOPIC_EVENTS_SUFFIX = ".events";
-    public static final String PROPERTY_TOPIC_EVENTS_FILTER_SUFFIX = ".filter";
-    public static final String PROPERTY_TOPIC_EVENTS_CUSTOM_MODEL_CODER_GSON_SUFFIX = ".events.custom.gson";
-
-    public static final String PROPERTY_TOPIC_SOURCE_CONSUMER_GROUP_SUFFIX = ".consumerGroup";
-    public static final String PROPERTY_TOPIC_SOURCE_CONSUMER_INSTANCE_SUFFIX = ".consumerInstance";
-    public static final String PROPERTY_TOPIC_SOURCE_FETCH_TIMEOUT_SUFFIX = ".fetchTimeout";
-    public static final String PROPERTY_TOPIC_SOURCE_FETCH_LIMIT_SUFFIX = ".fetchLimit";
     public static final String PROPERTY_MANAGED_SUFFIX = ".managed";
-    public static final String PROPERTY_ADDITIONAL_PROPS_SUFFIX = ".additionalProps";
-
-    public static final String PROPERTY_TOPIC_SINK_PARTITION_KEY_SUFFIX = ".partitionKey";
-
     public static final String PROPERTY_ALLOW_SELF_SIGNED_CERTIFICATES_SUFFIX = ".selfSignedCertificates";
 
-    public static final String PROPERTY_NOOP_SOURCE_TOPICS = "noop.source.topics";
-    public static final String PROPERTY_NOOP_SINK_TOPICS = "noop.sink.topics";
-
-    /* KAFKA Properties */
-
-    public static final String PROPERTY_KAFKA_SOURCE_TOPICS = "kafka.source.topics";
-    public static final String PROPERTY_KAFKA_SINK_TOPICS = "kafka.sink.topics";
-
     /* HTTP Server Properties */
 
     public static final String PROPERTY_HTTP_SERVER_SERVICES = "http.server.services";
@@ -90,33 +65,4 @@ public final class PolicyEndPointProperties {
 
     public static final String PROPERTY_HTTP_URL_SUFFIX = PROPERTY_HTTP_CONTEXT_URIPATH_SUFFIX;
 
-    /* Topic Sink Values */
-
-    /**
-     * Log Failures after X number of retries.
-     */
-    public static final int DEFAULT_LOG_SEND_FAILURES_AFTER = 1;
-
-
-    /* Topic Source values */
-
-    /**
-     * Default Timeout fetching in milliseconds.
-     */
-    public static final int DEFAULT_TIMEOUT_MS_FETCH = 15000;
-
-    /**
-     * Default maximum number of messages fetch at the time.
-     */
-    public static final int DEFAULT_LIMIT_FETCH = 100;
-
-    /**
-     * Definition of No Timeout fetching.
-     */
-    public static final int NO_TIMEOUT_MS_FETCH = -1;
-
-    /**
-     * Definition of No limit fetching.
-     */
-    public static final int NO_LIMIT_FETCH = -1;
 }
diff --git a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusTopicParamsTest.java b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusTopicParamsTest.java
deleted file mode 100644 (file)
index e016ca2..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * policy-endpoints
- * ================================================================================
- * Copyright (C) 2018-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.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.common.endpoints.event.comm.bus.internal;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
-import java.util.LinkedList;
-import java.util.List;
-import java.util.function.BiConsumer;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.onap.policy.common.endpoints.event.comm.bus.TopicTestBase;
-import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams.TopicParamsBuilder;
-
-class BusTopicParamsTest extends TopicTestBase {
-
-    @BeforeEach
-    @Override
-    public void setUp() {
-        super.setUp();
-    }
-
-    @Test
-    void testGetters() {
-        BusTopicParams params = makeBuilder().build();
-
-        assertEquals(addProps, params.getAdditionalProps());
-        assertEquals(MY_AFT_ENV, params.getAftEnvironment());
-        assertTrue(params.isAllowSelfSignedCerts());
-        assertEquals(MY_API_KEY, params.getApiKey());
-        assertEquals(MY_API_SECRET, params.getApiSecret());
-        assertEquals(MY_BASE_PATH, params.getBasePath());
-        assertEquals(MY_CLIENT_NAME, params.getClientName());
-        assertEquals(MY_CONS_GROUP, params.getConsumerGroup());
-        assertEquals(MY_CONS_INST, params.getConsumerInstance());
-        assertEquals(MY_ENV, params.getEnvironment());
-        assertEquals(MY_FETCH_LIMIT, params.getFetchLimit());
-        assertEquals(MY_FETCH_TIMEOUT, params.getFetchTimeout());
-        assertEquals(MY_HOST, params.getHostname());
-        assertEquals(MY_LAT, params.getLatitude());
-        assertEquals(MY_LONG, params.getLongitude());
-        assertTrue(params.isManaged());
-        assertEquals(MY_PARTITION, params.getPartitionId());
-        assertEquals(MY_PARTNER, params.getPartner());
-        assertEquals(MY_PASS, params.getPassword());
-        assertEquals(MY_PORT, params.getPort());
-        assertEquals(servers, params.getServers());
-        assertEquals(MY_TOPIC, params.getTopic());
-        assertEquals(MY_EFFECTIVE_TOPIC, params.getEffectiveTopic());
-        assertTrue(params.isUseHttps());
-        assertEquals(MY_USERNAME, params.getUserName());
-    }
-
-    @Test
-    void testBooleanGetters() {
-        // ensure that booleans are independent of each other
-        testBoolean("true:false:false", TopicParamsBuilder::allowSelfSignedCerts);
-        testBoolean("false:true:false", TopicParamsBuilder::managed);
-        testBoolean("false:false:true", TopicParamsBuilder::useHttps);
-    }
-
-    @Test
-    void testValidators() {
-        BusTopicParams params = makeBuilder().build();
-
-        // test validity methods
-        assertTrue(params.isAdditionalPropsValid());
-        assertFalse(params.isAftEnvironmentInvalid());
-        assertTrue(params.isApiKeyValid());
-        assertTrue(params.isApiSecretValid());
-        assertFalse(params.isClientNameInvalid());
-        assertFalse(params.isConsumerGroupInvalid());
-        assertFalse(params.isConsumerInstanceInvalid());
-        assertFalse(params.isEnvironmentInvalid());
-        assertFalse(params.isHostnameInvalid());
-        assertFalse(params.isLatitudeInvalid());
-        assertFalse(params.isLongitudeInvalid());
-        assertFalse(params.isPartitionIdInvalid());
-        assertFalse(params.isPartnerInvalid());
-        assertTrue(params.isPasswordValid());
-        assertFalse(params.isPortInvalid());
-        assertFalse(params.isServersInvalid());
-        assertFalse(params.isTopicInvalid());
-        assertTrue(params.isUserNameValid());
-    }
-
-    @Test
-    void testInvertedValidators() {
-        assertFalse(makeBuilder().additionalProps(null).build().isAdditionalPropsValid());
-        assertTrue(makeBuilder().aftEnvironment("").build().isAftEnvironmentInvalid());
-        assertFalse(makeBuilder().apiKey("").build().isApiKeyValid());
-        assertFalse(makeBuilder().apiSecret("").build().isApiSecretValid());
-        assertTrue(makeBuilder().clientName("").build().isClientNameInvalid());
-        assertTrue(makeBuilder().consumerGroup("").build().isConsumerGroupInvalid());
-        assertTrue(makeBuilder().consumerInstance("").build().isConsumerInstanceInvalid());
-        assertTrue(makeBuilder().environment("").build().isEnvironmentInvalid());
-        assertTrue(makeBuilder().hostname("").build().isHostnameInvalid());
-        assertTrue(makeBuilder().latitude("").build().isLatitudeInvalid());
-        assertTrue(makeBuilder().longitude("").build().isLongitudeInvalid());
-        assertTrue(makeBuilder().partitionId("").build().isPartitionIdInvalid());
-        assertTrue(makeBuilder().partner("").build().isPartnerInvalid());
-        assertFalse(makeBuilder().password("").build().isPasswordValid());
-        assertTrue(makeBuilder().port(-1).build().isPortInvalid());
-        assertTrue(makeBuilder().port(65536).build().isPortInvalid());
-        assertTrue(makeBuilder().servers(null).build().isServersInvalid());
-        assertTrue(makeBuilder().servers(new LinkedList<>()).build().isServersInvalid());
-        assertTrue(makeBuilder().servers(List.of("")).build().isServersInvalid());
-        assertFalse(makeBuilder().servers(List.of("one-server")).build().isServersInvalid());
-        assertTrue(makeBuilder().topic("").build().isTopicInvalid());
-        assertFalse(makeBuilder().userName("").build().isUserNameValid());
-    }
-
-    /**
-     * Tests the boolean methods by applying a function, once with {@code false} and once
-     * with {@code true}. Verifies that all the boolean methods return the correct
-     * value by concatenating them.
-     *
-     * @param expectedTrue the string that is expected when {@code true} is passed to the
-     *        method
-     * @param function function to be applied to the builder
-     */
-    private void testBoolean(String expectedTrue, BiConsumer<TopicParamsBuilder, Boolean> function) {
-        TopicParamsBuilder builder = BusTopicParams.builder();
-
-        // first try the "false" case
-        function.accept(builder, false);
-
-        BusTopicParams params = builder.build();
-        assertEquals("false:false:false",
-                        params.isAllowSelfSignedCerts() + ":" + params.isManaged() + ":" + params.isUseHttps());
-
-
-        // now try the "true" case
-        function.accept(builder, true);
-
-        params = builder.build();
-        assertEquals(expectedTrue,
-                        params.isAllowSelfSignedCerts() + ":" + params.isManaged() + ":" + params.isUseHttps());
-    }
-}
index 3d80aa8..10d4005 100644 (file)
@@ -41,11 +41,11 @@ import java.util.TreeMap;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 import lombok.Getter;
+import lombok.Setter;
 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.bus.internal.BusTopicParams;
 import org.onap.policy.common.endpoints.http.client.HttpClient;
 import org.onap.policy.common.endpoints.http.client.HttpClientConfigException;
 import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance;
@@ -53,6 +53,7 @@ import org.onap.policy.common.endpoints.http.server.HttpServletServer;
 import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
 import org.onap.policy.common.endpoints.http.server.internal.JettyJerseyServer;
 import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
 import org.onap.policy.common.utils.network.NetworkUtil;
 
 class HttpClientTest {
@@ -532,6 +533,8 @@ class HttpClientTest {
     }
 
 
+    @Setter
+    @Getter
     static class MyEntity {
 
         private String myParameter;
@@ -540,14 +543,6 @@ class HttpClientTest {
             this.myParameter = myParameter;
         }
 
-        public void setMyParameter(final String myParameter) {
-            this.myParameter = myParameter;
-        }
-
-        public String getMyParameter() {
-            return myParameter;
-        }
-
     }
 
     static class MyCallback implements InvocationCallback<Response> {
@@ -557,7 +552,7 @@ class HttpClientTest {
         @Getter
         private Throwable throwable;
 
-        private CountDownLatch latch = new CountDownLatch(1);
+        private final CountDownLatch latch = new CountDownLatch(1);
 
         @Override
         public void completed(Response response) {
index 818851f..399754a 100644 (file)
@@ -242,7 +242,7 @@ class HttpServerTest {
      */
     @Test
     void testExplicitPrometheusServer() throws Exception {
-        logger.info("-- testPrometheusServer() --");
+        logger.info("-- testExplicitPrometheusServer() --");
 
         HttpServletServer server = HttpServletServerFactoryInstance.getServerFactory()
             .build(PROMETHEUS, LOCALHOST, port, "/", false, true);
@@ -261,7 +261,7 @@ class HttpServerTest {
      */
     @Test
     void testPrometheusJaxRsFilterSwaggerServer() throws Exception {
-        logger.info("-- testPrometheusServer() --");
+        logger.info("-- testPrometheusJaxRsFilterSwaggerServer() --");
 
         HttpServletServer server = HttpServletServerFactoryInstance.getServerFactory()
             .build(PROMETHEUS, LOCALHOST, port, "/", true, true);
index 1803040..431dae7 100644 (file)
@@ -65,9 +65,9 @@ import org.onap.policy.common.endpoints.http.server.RestServer;
 import org.onap.policy.common.endpoints.http.server.RestServer.Factory;
 import org.onap.policy.common.endpoints.http.server.YamlExceptionMapper;
 import org.onap.policy.common.endpoints.http.server.YamlMessageBodyHandler;
-import org.onap.policy.common.endpoints.parameters.RestServerParameters;
 import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
 import org.onap.policy.common.gson.GsonMessageBodyHandler;
+import org.onap.policy.common.parameters.rest.RestServerParameters;
 import org.onap.policy.common.utils.coder.StandardCoder;
 import org.onap.policy.common.utils.network.NetworkUtil;
 import org.springframework.test.util.ReflectionTestUtils;
index 11cd3c5..c2e5f90 100644 (file)
@@ -36,7 +36,7 @@ import org.junit.jupiter.api.AfterEach;
 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.coder.StandardCoderObject;
 import org.onap.policy.common.utils.test.log.logback.ExtractAppender;
 import org.slf4j.LoggerFactory;
index 95dd9f5..e0184bd 100644 (file)
@@ -37,7 +37,7 @@ import org.junit.jupiter.api.AfterEach;
 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.coder.StandardCoderObject;
 import org.onap.policy.common.utils.test.log.logback.ExtractAppender;
 import org.slf4j.LoggerFactory;
index 1158a4c..ac61ae7 100644 (file)
@@ -37,7 +37,7 @@ import org.junit.jupiter.api.AfterEach;
 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.coder.Coder;
 import org.onap.policy.common.utils.coder.CoderException;
 import org.onap.policy.common.utils.coder.StandardCoder;
index 4236a77..cb8fb70 100644 (file)
@@ -34,7 +34,7 @@ import org.junit.jupiter.api.AfterEach;
 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.coder.Coder;
 import org.onap.policy.common.utils.coder.CoderException;
 import org.onap.policy.common.utils.coder.StandardCoder;
@@ -62,8 +62,6 @@ class ScoListenerTest {
     private static final Coder coder = new StandardCoder();
 
     private ScoListener<MyMessage> primary;
-    private MyMessage status;
-    private StandardCoderObject sco;
 
     /**
      * Initializes statics.
@@ -108,8 +106,8 @@ class ScoListenerTest {
     void testOnTopicEvent() {
         primary = spy(primary);
 
-        status = new MyMessage(NAME);
-        sco = makeSco(status);
+        MyMessage status = new MyMessage(NAME);
+        StandardCoderObject sco = makeSco(status);
         primary.onTopicEvent(INFRA, TOPIC, sco);
         verify(primary).onTopicEvent(INFRA, TOPIC, sco, status);
 
@@ -117,7 +115,7 @@ class ScoListenerTest {
 
         // undecodable message
         logger.addAppender(appender);
-        primary.onTopicEvent(INFRA, TOPIC, makeSco("[]"));
+        primary.onTopicEvent(INFRA, TOPIC, makeSco());
         verify(primary, times(1)).onTopicEvent(INFRA, TOPIC, sco, status);
         assertTrue(appender.getExtracted().toString().contains("unable to decode"));
     }
@@ -125,12 +123,11 @@ class ScoListenerTest {
     /**
      * Makes a standard object from a JSON string.
      *
-     * @param source message to be converted
      * @return a standard object representing the message
      */
-    private StandardCoderObject makeSco(String source) {
+    private StandardCoderObject makeSco() {
         try {
-            return coder.decode(source, StandardCoderObject.class);
+            return coder.decode("[]", StandardCoderObject.class);
 
         } catch (CoderException e) {
             throw new RuntimeException(e);
@@ -184,13 +181,10 @@ class ScoListenerTest {
             }
             MyMessage other = (MyMessage) obj;
             if (name == null) {
-                if (other.name != null) {
-                    return false;
-                }
-            } else if (!name.equals(other.name)) {
-                return false;
+                return other.name == null;
+            } else {
+                return name.equals(other.name);
             }
-            return true;
         }
     }
 }
diff --git a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/rest/CommonTestData.java b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/rest/CommonTestData.java
new file mode 100644 (file)
index 0000000..3e16b8a
--- /dev/null
@@ -0,0 +1,99 @@
+/*-
+ * ============LICENSE_START=======================================================
+ *  Copyright (C) 2019, 2024 Nordix Foundation.
+ *  Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.common.endpoints.rest;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.util.Map;
+import java.util.TreeMap;
+import org.onap.policy.common.parameters.ParameterGroup;
+import org.onap.policy.common.utils.coder.Coder;
+import org.onap.policy.common.utils.coder.CoderException;
+import org.onap.policy.common.utils.coder.StandardCoder;
+
+/**
+ * Class to hold/create all parameters for test cases.
+ *
+ * @author Ajith Sreekumar (ajith.sreekumar@est.tech)
+ */
+public class CommonTestData {
+
+    public static final String REST_SERVER_PASS = "zb!XztG34";
+    public static final String REST_SERVER_USER = "healthcheck";
+    public static final int REST_SERVER_PORT = 6969;
+    public static final String REST_SERVER_HOST = "0.0.0.0";
+    public static final boolean REST_SERVER_HTTPS = true;
+    public static final boolean REST_SERVER_AAF = false;
+
+    protected static final Coder coder = new StandardCoder();
+
+    /**
+     * Converts the contents of a map to a parameter class.
+     *
+     * @param source property map
+     * @param clazz class of object to be created from the map
+     * @return a new object represented by the map
+     */
+    public <T extends ParameterGroup> T toObject(final Map<String, Object> source, final Class<T> clazz) {
+        try {
+            return coder.decode(coder.encode(source), clazz);
+
+        } catch (final CoderException e) {
+            throw new RuntimeException("cannot create " + clazz.getName() + " from map", e);
+        }
+    }
+
+    /**
+     * Returns a property map for a RestServerParameters map for test cases.
+     *
+     * @param isEmpty boolean value to represent that object created should be empty or not
+     * @return a property map suitable for constructing an object
+     */
+    public Map<String, Object> getRestServerParametersMap(final boolean isEmpty) {
+        final Map<String, Object> map = new TreeMap<>();
+        map.put("https", REST_SERVER_HTTPS);
+        map.put("aaf", REST_SERVER_AAF);
+
+        if (!isEmpty) {
+            map.put("host", REST_SERVER_HOST);
+            map.put("port", REST_SERVER_PORT);
+            map.put("userName", REST_SERVER_USER);
+            map.put("password", REST_SERVER_PASS);
+        }
+
+        return map;
+    }
+
+    /**
+     * Gets the standard parameter group as a String.
+     *
+     * @param filePath path of the file
+     * @return the standard parameters
+     * @throws IOException when file read operation fails
+     */
+    public String getParameterGroupAsString(String filePath) throws IOException {
+        File file = new File(filePath);
+        return Files.readString(file.toPath());
+    }
+}
@@ -19,7 +19,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.parameters;
+package org.onap.policy.common.endpoints.rest;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -29,6 +29,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import org.junit.jupiter.api.Test;
 import org.onap.policy.common.parameters.ValidationResult;
+import org.onap.policy.common.parameters.rest.RestServerParameters;
 import org.onap.policy.common.utils.coder.Coder;
 import org.onap.policy.common.utils.coder.StandardCoder;
 
@@ -39,7 +40,7 @@ import org.onap.policy.common.utils.coder.StandardCoder;
  */
 class RestServerParametersTest {
 
-    private static CommonTestData testData = new CommonTestData();
+    private static final CommonTestData testData = new CommonTestData();
     private static final Coder coder = new StandardCoder();
 
     @Test
@@ -68,7 +69,7 @@ class RestServerParametersTest {
     @Test
     void test_valid() throws Exception {
         String json = testData.getParameterGroupAsString(
-            "src/test/resources/org/onap/policy/common/endpoints/parameters/RestServerParameters_valid.json");
+            "src/test/resources/org/onap/policy/common/endpoints/rest/RestServerParameters_valid.json");
         RestServerParameters restServerParameters = coder.decode(json, RestServerParameters.class);
         final ValidationResult result = restServerParameters.validate();
         assertNull(result.getResult());
@@ -78,7 +79,7 @@ class RestServerParametersTest {
     @Test
     void test_invalid() throws Exception {
         String json = testData.getParameterGroupAsString(
-            "src/test/resources/org/onap/policy/common/endpoints/parameters/RestServerParameters_invalid.json");
+            "src/test/resources/org/onap/policy/common/endpoints/rest/RestServerParameters_invalid.json");
         RestServerParameters restServerParameters = coder.decode(json, RestServerParameters.class);
         final ValidationResult result = restServerParameters.validate();
         assertFalse(result.isValid());
diff --git a/policy-endpoints/src/test/resources/META-INF/services/org.onap.policy.common.endpoints.features.NetLoggerFeatureApi b/policy-endpoints/src/test/resources/META-INF/services/org.onap.policy.common.endpoints.features.NetLoggerFeatureApi
deleted file mode 100644 (file)
index c861ad1..0000000
+++ /dev/null
@@ -1 +0,0 @@
-org.onap.policy.common.endpoints.utils.NetLoggerUtilTest$NetLoggerFeature
diff --git a/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/InlineKafkaTopicSinkTest.json b/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/InlineKafkaTopicSinkTest.json
deleted file mode 100644 (file)
index dc1f1f7..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-{
-  "servers": [
-    "svra",
-    "svrb"
-  ],
-  "topic": "my-topic",
-  "effectiveTopic": "my-effective-topic",
-  "recentEvents": [],
-  "alive": false,
-  "locked": false,
-  "useHttps": false,
-  "allowTracing": false,
-  "topicCommInfrastructure": "KAFKA",
-  "partitionKey": "my-partition",
-  "additionalProps": {
-    "security.protocol": "SASL_PLAINTEXT",
-    "sasl.mechanism": "SCRAM-SHA-512",
-    "sasl.jaas.config": "org.apache.kafka.common.security.plain.PlainLoginModule required username=abc password=abc serviceName=kafka;"
-  }
-}
diff --git a/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/SingleThreadedKafkaTopicSourceTest.json b/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/event/comm/bus/internal/SingleThreadedKafkaTopicSourceTest.json
deleted file mode 100644 (file)
index a101d23..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-{
-  "servers": [
-    "localhost:9092",
-    "10.1.2.3:9092"
-  ],
-  "topic": "my-topic",
-  "effectiveTopic": "my-effective-topic",
-  "recentEvents": [],
-  "alive": false,
-  "locked": false,
-  "useHttps": false,
-  "allowTracing": false,
-  "topicCommInfrastructure": "KAFKA",
-  "additionalProps": {
-    "security.protocol": "SASL_PLAINTEXT",
-    "sasl.mechanism": "SCRAM-SHA-512",
-    "sasl.jaas.config": "org.apache.kafka.common.security.plain.PlainLoginModule required username=abc password=abc serviceName=kafka;"
-  }
-}
diff --git a/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/rest/TopicParameters_all_params.json b/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/rest/TopicParameters_all_params.json
new file mode 100644 (file)
index 0000000..89e464d
--- /dev/null
@@ -0,0 +1,62 @@
+{
+    "topicSources" : [ {
+        "topic" : "policy-pdp-pap1",
+        "servers" : [ "kafka2, kafka3" ],
+        "topicCommInfrastructure" : "kafka",
+        "effectiveTopic" : "my-effective-topic",
+        "apiKey" : "my-api-key",
+        "apiSecret" : "my-api-secret",
+        "port": 123,
+        "useHttps" : true,
+        "allowTracing": true,
+        "allowSelfSignedCerts" : true,
+        "consumerGroup" : "consumer group",
+        "consumerInstance" : "consumer instance",
+        "fetchTimeout" : 15000,
+        "fetchLimit" : 100,
+        "userName": "username",
+        "password": "password",
+        "managed": true,
+        "environment": "environment1",
+        "aftEnvironment": "aftEnvironment1",
+        "partner": "partner1",
+        "latitude": "1234",
+        "longitude": "1234",
+        "partitionId": "partition_id",
+        "additionalProps": {"xyz":"xyz"},
+        "clientName": "clientName1",
+        "hostname": "hostname1",
+        "basePath": "basePath1",
+        "serializationProvider": "serializationProvider1"
+    }],
+    "topicSinks" : [ {
+        "topic" : "policy-pdp-pap1",
+        "servers" : [ "kafka2, kafka3" ],
+        "topicCommInfrastructure" : "kafka",
+        "effectiveTopic" : "my-effective-topic",
+        "apiKey" : "my-api-key",
+        "apiSecret" : "my-api-secret",
+        "port": 123,
+        "useHttps" : true,
+        "allowTracing": true,
+        "allowSelfSignedCerts" : true,
+        "consumerGroup" : "consumer group",
+        "consumerInstance" : "consumer instance",
+        "fetchTimeout" : 15000,
+        "fetchLimit" : 100,
+        "userName": "username",
+        "password": "password",
+        "managed": true,
+        "environment": "environment1",
+        "aftEnvironment": "aftEnvironment1",
+        "partner": "partner1",
+        "latitude": "1234",
+        "longitude": "1234",
+        "partitionId": "partition_id",
+        "additionalProps": {"xyz":"xyz"},
+        "clientName": "clientName1",
+        "hostname": "hostname1",
+        "basePath": "basePath1",
+        "serializationProvider": "serializationProvider1"
+    }]
+}
\ No newline at end of file
diff --git a/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/rest/TopicParameters_invalid.json b/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/rest/TopicParameters_invalid.json
new file mode 100644 (file)
index 0000000..775b488
--- /dev/null
@@ -0,0 +1,6 @@
+{
+    "topicSources" : [{
+        "topic" : "ueb-source",
+        "servers" : ["my-server"]
+    }]
+}
\ No newline at end of file
diff --git a/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/rest/TopicParameters_missing_mandatory.json b/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/rest/TopicParameters_missing_mandatory.json
new file mode 100644 (file)
index 0000000..216c11e
--- /dev/null
@@ -0,0 +1,12 @@
+{
+    "topicSources" : [ {
+        "topic" : "policy-pdp-pap1",
+        "servers" : [],
+        "topicCommInfrastructure" : "kafka"
+    }],
+    "topicSinks" : [ {
+        "topic" : "policy-pdp-pap2",
+        "servers" : [ "kafka1, kafka2" ],
+        "topicCommInfrastructure" : "kafka"
+    }]
+}
\ No newline at end of file
diff --git a/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/rest/TopicParameters_valid.json b/policy-endpoints/src/test/resources/org/onap/policy/common/endpoints/rest/TopicParameters_valid.json
new file mode 100644 (file)
index 0000000..2603bfd
--- /dev/null
@@ -0,0 +1,30 @@
+{
+    "topicSources" : [ {
+        "topic" : "ueb-source",
+        "servers" : [ "my-server" ],
+        "topicCommInfrastructure" : "ueb"
+    },{
+        "topic" : "policy-pdp-pap1",
+        "servers" : [ "kafka1, kafka2" ],
+        "topicCommInfrastructure" : "kafka"
+    },{
+        "topic" : "policy-pdp-pap2",
+        "servers" : [ "kafka2, kafka3" ],
+        "topicCommInfrastructure" : "kafka"
+    }],
+    "topicSinks" : [ {
+        "topic" : "ueb-sink",
+        "servers" : [ "my-server" ],
+        "topicCommInfrastructure" : "ueb"
+    },{
+        "topic" : "policy-pdp-pap2",
+        "servers" : [ "kafka1, kafka2" ],
+        "topicCommInfrastructure" : "kafka"
+    },{
+        "topic" : "policy-pdp-pap3",
+        "servers" : [ "kafka2, kafka3" ],
+        "topicCommInfrastructure" : "kafka",
+        "effectiveTopic":"effectiveTopic1",
+        "allowSelfSignedCerts":true
+    }]
+}
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index e841eb4..572d62b 100644 (file)
--- a/pom.xml
+++ b/pom.xml
 
     <modules>
         <module>capabilities</module>
-        <module>utils-test</module>
-        <module>utils</module>
-        <module>gson</module>
         <module>common-parameters</module>
-        <module>policy-endpoints</module>
+        <module>gson</module>
+        <module>utils</module>
+        <module>utils-test</module>
         <module>spring-utils</module>
+        <module>message-bus</module>
+        <module>policy-endpoints</module>
     </modules>
 
     <build>
index d5d5d84..d81b4f0 100644 (file)
             <artifactId>utils</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-core</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-web</artifactId>
         </dependency>
         <dependency>
             <groupId>org.mockito</groupId>
-            <artifactId>mockito-junit-jupiter</artifactId>
+            <artifactId>mockito-core</artifactId>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>org.assertj</groupId>
-            <artifactId>assertj-core</artifactId>
-        </dependency>
     </dependencies>
 
 </project>
\ No newline at end of file
index 6338cc0..a8a282e 100644 (file)
@@ -3,7 +3,7 @@
   ONAP Policy Engine - Common Modules
   ================================================================================
   Copyright (C) 2018-2021 AT&T Intellectual Property. All rights reserved.
-  Modificaitons Copyright (C) 2023-2024 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.
@@ -19,7 +19,8 @@
   ============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>
 
     <dependencies>
         <dependency>
-            <groupId>org.bouncycastle</groupId>
-            <artifactId>bcpkix-fips</artifactId>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>utils</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.policy.common</groupId>
+            <artifactId>gson</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-jexl3</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.bouncycastle</groupId>
+            <artifactId>bcpkix-fips</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>org.onap.policy.common</groupId>
-            <artifactId>utils</artifactId>
-            <version>${project.version}</version>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-core</artifactId>
             <scope>provided</scope>
         </dependency>
-
-        <!-- from parent -->
-         <dependency>
-            <groupId>org.awaitility</groupId>
-            <artifactId>awaitility</artifactId>
-            <scope>test</scope>
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.google.re2j</groupId>
+            <artifactId>re2j</artifactId>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>com.openpojo</groupId>
             <artifactId>openpojo</artifactId>
             <scope>compile</scope>
         </dependency>
+        <dependency>
+            <groupId>org.hamcrest</groupId>
+            <artifactId>hamcrest</artifactId>
+            <scope>compile</scope>
+        </dependency>
         <dependency>
             <groupId>org.junit.jupiter</groupId>
             <artifactId>junit-jupiter-api</artifactId>
             <scope>compile</scope>
         </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>provided</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>
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-core</artifactId>
+            <scope>test</scope>
+        </dependency>
         <dependency>
             <groupId>org.mockito</groupId>
             <artifactId>mockito-junit-jupiter</artifactId>
             <artifactId>spring-test</artifactId>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>org.hamcrest</groupId>
-            <artifactId>hamcrest-core</artifactId>
-            <version>2.2</version>
-            <scope>compile</scope>
-        </dependency>
     </dependencies>
 </project>
index 791a048..18550e4 100644 (file)
             <version>${project.version}</version>
         </dependency>
         <dependency>
-            <groupId>commons-net</groupId>
-            <artifactId>commons-net</artifactId>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.google.re2j</groupId>
+            <artifactId>re2j</artifactId>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <artifactId>commons-io</artifactId>
         </dependency>
         <dependency>
-            <groupId>jakarta.persistence</groupId>
-            <artifactId>jakarta.persistence-api</artifactId>
+            <groupId>commons-net</groupId>
+            <artifactId>commons-net</artifactId>
         </dependency>
         <dependency>
-            <groupId>ch.qos.logback</groupId>
-            <artifactId>logback-classic</artifactId>
+            <groupId>jakarta.persistence</groupId>
+            <artifactId>jakarta.persistence-api</artifactId>
         </dependency>
         <dependency>
-            <groupId>ch.qos.logback</groupId>
-            <artifactId>logback-core</artifactId>
+            <groupId>jakarta.xml.bind</groupId>
+            <artifactId>jakarta.xml.bind-api</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-lang3</artifactId>
         </dependency>
         <dependency>
-            <groupId>com.google.re2j</groupId>
-            <artifactId>re2j</artifactId>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.yaml</groupId>
             <artifactId>snakeyaml</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.openpojo</groupId>
+            <artifactId>openpojo</artifactId>
+            <scope>test</scope>
+        </dependency>
         <dependency>
             <groupId>org.assertj</groupId>
             <artifactId>assertj-core</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.hamcrest</groupId>
+            <artifactId>hamcrest</artifactId>
+            <scope>test</scope>
+        </dependency>
         <dependency>
             <groupId>org.mockito</groupId>
-            <artifactId>mockito-junit-jupiter</artifactId>
+            <artifactId>mockito-core</artifactId>
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>jakarta.xml.bind</groupId>
-            <artifactId>jakarta.xml.bind-api</artifactId>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-junit-jupiter</artifactId>
+            <scope>test</scope>
         </dependency>
     </dependencies>
 </project>
@@ -18,7 +18,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.utils;
+package org.onap.policy.common.utils.properties;
 
 import java.util.Properties;
 import lombok.AllArgsConstructor;
@@ -1,8 +1,9 @@
 /*-
- * ============LICENSE_START=======================================================
+ * ============LICENSE_START===============================================================
  *  Copyright (C) 2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2018, 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.
  * You may obtain a copy of the License at
@@ -19,7 +20,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.report;
+package org.onap.policy.common.utils.report;
 
 import lombok.Getter;
 import lombok.Setter;
index 998d674..3726ef8 100644 (file)
@@ -3,6 +3,7 @@
  * utils
  * ================================================================================
  * Copyright (C) 2019-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.
@@ -35,22 +36,22 @@ import org.slf4j.LoggerFactory;
  */
 public class OrderedServiceImpl<T extends OrderedService> {
     // logger
-    private static Logger  logger = LoggerFactory.getLogger(OrderedServiceImpl.class);
+    private static final Logger logger = LoggerFactory.getLogger(OrderedServiceImpl.class);
 
     // sorted list of instances implementing the service
     private List<T> implementers = null;
 
     // 'ServiceLoader' that is used to discover and create the services
-    private ServiceLoader<T> serviceLoader = null;
+    private final ServiceLoader<T> serviceLoader;
 
     // use this to ensure that we only use one unique instance of each class
-    private static Map<Class<?>, OrderedService> classToSingleton = new HashMap<>();
+    private static final Map<Class<?>, OrderedService> classToSingleton = new HashMap<>();
 
     /**
      * Constructor - create the 'ServiceLoader' instance.
      *
      * @param clazz the class object associated with 'T' (I supposed it could
-     *     be a subclass, but I'm not sure this is useful)
+     *              be a subclass, but I'm not sure if this is useful)
      */
     public OrderedServiceImpl(Class<T> clazz) {
         // This constructor wouldn't be needed if 'T.class' was legal
@@ -60,8 +61,7 @@ public class OrderedServiceImpl<T extends OrderedService> {
     /**
      * Get List of implementers.
      *
-     * @return the sorted list of services implementing interface 'T' discovered
-     *     by 'ServiceLoader'.
+     * @return the sorted list of services implementing interface 'T' discovered by 'ServiceLoader'.
      */
     public synchronized List<T> getList() {
         if (implementers == null) {
@@ -78,12 +78,11 @@ public class OrderedServiceImpl<T extends OrderedService> {
      * expensive operation in terms of CPU and elapsed time, so it is best if it
      * isn't invoked too frequently.
      *
-     * @return the sorted list of services implementing interface 'T' discovered
-     *      by 'ServiceLoader'.
+     * @return the sorted list of services implementing interface 'T' discovered by 'ServiceLoader'.
      */
     @SuppressWarnings("unchecked")
     public synchronized List<T> rebuildList() {
-        // build a list of all of the current implementors
+        // build a list of all the current implementors
         List<T> tmp = new LinkedList<>();
         for (T service : serviceLoader) {
             tmp.add((T) getSingleton(service));
@@ -91,7 +90,7 @@ public class OrderedServiceImpl<T extends OrderedService> {
 
         // Sort the list according to sequence number, and then alphabetically
         // according to full class name.
-        Collections.sort(tmp, (o1, o2) -> {
+        tmp.sort((o1, o2) -> {
             int s1 = o1.getSequenceNumber();
             int s2 = o2.getSequenceNumber();
             if (s1 < s2) {
@@ -112,7 +111,7 @@ public class OrderedServiceImpl<T extends OrderedService> {
     /**
      * If a service implements multiple APIs managed by 'ServiceLoader', a
      * separate instance is created for each API. This method ensures that
-     * the first instance is used in all of the lists.
+     * the first instance is used in all the lists.
      *
      * @param service this is the object created by ServiceLoader
      * @return the object to use in place of 'service'. If 'service' is the first
@@ -19,7 +19,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.utils;
+package org.onap.policy.common.utils.properties;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertFalse;
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.endpoints.report;
+package org.onap.policy.common.utils.report;
 
+import static org.hamcrest.CoreMatchers.anyOf;
+import static org.hamcrest.CoreMatchers.anything;
+
+import com.openpojo.reflection.PojoClass;
 import com.openpojo.reflection.filters.FilterClassName;
 import com.openpojo.validation.Validator;
 import com.openpojo.validation.ValidatorBuilder;
+import com.openpojo.validation.affirm.Affirm;
 import com.openpojo.validation.rule.impl.GetterMustExistRule;
 import com.openpojo.validation.rule.impl.SetterMustExistRule;
+import com.openpojo.validation.test.Tester;
 import com.openpojo.validation.test.impl.GetterTester;
 import com.openpojo.validation.test.impl.SetterTester;
+import com.openpojo.validation.utils.ValidationHelper;
+import org.hamcrest.Matcher;
 import org.junit.jupiter.api.Test;
-import org.onap.policy.common.utils.test.ToStringTester;
 
 /**
  * Class to perform unit test of HealthCheckReport.
@@ -47,4 +54,25 @@ class TestHealthCheckReport {
         validator.validate(HealthCheckReport.class.getPackage().getName(),
                 new FilterClassName(HealthCheckReport.class.getName()));
     }
+
+    static class ToStringTester implements Tester {
+
+        private final Matcher<?> matcher;
+
+        public ToStringTester() {
+            matcher = anything();
+        }
+
+        @Override
+        public void run(final PojoClass pojoClass) {
+            final Class<?> clazz = pojoClass.getClazz();
+            if (anyOf(matcher).matches(clazz)) {
+                final Object classInstance = ValidationHelper.getBasicInstance(pojoClass);
+
+                Affirm.affirmFalse("Found default toString output",
+                    classInstance.toString().matches(Object.class.getName() + "@" + "\\w+"));
+            }
+
+        }
+    }
 }
index d1e891c..9db367c 100644 (file)
@@ -313,7 +313,7 @@ class ResourceUtilsTest {
                 normalizePath(resultD2.iterator().next()));
 
         Set<String> resultJ0 = ResourceUtils.getDirectoryContents("com");
-        assertTrue(resultJ0.contains("com/google/gson/"));
+        assertTrue(resultJ0.contains("com/google/"));
         assertEquals("com/google/", normalizePath(resultJ0.iterator().next()));
 
         Set<String> resultJ1 = ResourceUtils.getDirectoryContents("com/google/gson");