<artifactId>policy-models-errors</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>com.google.re2j</groupId>
+ <artifactId>re2j</artifactId>
+ </dependency>
<dependency>
<groupId>jakarta.persistence</groupId>
<artifactId>jakarta.persistence-api</artifactId>
</dependency>
+ <dependency>
+ <groupId>jakarta.ws.rs</groupId>
+ <artifactId>jakarta.ws.rs-api</artifactId>
+ </dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ </dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
</description>
<dependencies>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>common-parameters</artifactId>
+ <version>${policy.common.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>utils</artifactId>
+ <version>${policy.common.version}</version>
+ </dependency>
<dependency>
<groupId>org.onap.policy.models</groupId>
<artifactId>policy-models-base</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>com.google.re2j</groupId>
+ <artifactId>re2j</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.persistence</groupId>
+ <artifactId>jakarta.persistence-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.ws.rs</groupId>
+ <artifactId>jakarta.ws.rs-api</artifactId>
+ </dependency>
+ <dependency>
+ <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>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ </dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<dependency>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-core</artifactId>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
+ <scope>test</scope>
</dependency>
</dependencies>
</project>
<groupId>org.onap.policy.common</groupId>
<artifactId>gson</artifactId>
<version>${policy.common.version}</version>
- <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.onap.policy.models</groupId>
<version>${policy.common.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.ws.rs</groupId>
+ <artifactId>jakarta.ws.rs-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ </dependency>
<dependency>
<groupId>com.openpojo</groupId>
<artifactId>openpojo</artifactId>
<name>${project.artifactId}</name>
<description>The models for Policy API's to return Error/warning message details.</description>
<dependencies>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>utils</artifactId>
+ <version>${policy.common.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>utils-test</artifactId>
+ <version>${policy.common.version}</version>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<artifactId>jakarta.ws.rs-api</artifactId>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>org.onap.policy.common</groupId>
- <artifactId>utils</artifactId>
- <version>${policy.common.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.common</groupId>
- <artifactId>utils-test</artifactId>
- <version>${policy.common.version}</version>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<!--
============LICENSE_START=======================================================
Copyright (C) 2018 Wipro Limited Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2019-2020, 2023 Nordix Foundation.
+ Modifications Copyright (C) 2019-2020, 2023-2024 Nordix Foundation.
Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
</dependency>
<dependency>
<groupId>org.onap.policy.common</groupId>
- <artifactId>policy-endpoints</artifactId>
+ <artifactId>message-bus</artifactId>
<version>${policy.common.version}</version>
<scope>provided</scope>
</dependency>
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.function.BiConsumer;
-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.TopicSink;
+import org.onap.policy.common.message.bus.event.TopicSource;
import org.onap.policy.common.utils.coder.StandardCoderObject;
import org.onap.policy.controlloop.actor.test.BasicBidirectionalTopicOperation;
import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
<!--
============LICENSE_START=======================================================
Copyright (C) 2018 Huawei Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2019-2020, 2023 Nordix Foundation.
+ Modifications Copyright (C) 2019-2020, 2023-2024 Nordix Foundation.
Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
<groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
<artifactId>actorServiceProvider</artifactId>
<version>${project.version}</version>
- <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
<artifactId>aai</artifactId>
<version>${project.version}</version>
- <scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
- <artifactId>events</artifactId>
+ <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
+ <artifactId>actor.test</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models.policy-models-interactions</groupId>
+ <artifactId>simulators</artifactId>
<version>${project.version}</version>
- <scope>provided</scope>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.onap.policy.common</groupId>
<artifactId>policy-endpoints</artifactId>
<version>${policy.common.version}</version>
- <scope>provided</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>io.opentelemetry</groupId>
+ <artifactId>opentelemetry-context</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.kafka</groupId>
+ <artifactId>kafka-clients</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
- <artifactId>actor.test</artifactId>
- <version>${project.version}</version>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>message-bus</artifactId>
+ <version>${policy.common.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>common-parameters</artifactId>
+ <version>${policy.common.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>utils</artifactId>
+ <version>${policy.common.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>utils-test</artifactId>
+ <version>${policy.common.version}</version>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.onap.policy.models.policy-models-interactions</groupId>
- <artifactId>simulators</artifactId>
- <version>${project.version}</version>
+ <groupId>jakarta.ws.rs</groupId>
+ <artifactId>jakarta.ws.rs-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ </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>
</dependencies>
* 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.
import java.util.Map.Entry;
import java.util.concurrent.CompletableFuture;
import org.onap.policy.aai.AaiCqResponse;
-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.controlloop.actorserviceprovider.OperationOutcome;
import org.onap.policy.controlloop.actorserviceprovider.OperationProperties;
import org.onap.policy.controlloop.actorserviceprovider.OperationResult;
WebTarget web = getClient().getWebTarget().path(path);
str.append(path);
- web = addQuery(web, str, "?", "format", "resource");
+ web = addQuery(web, str);
Builder webldr = web.request();
for (Entry<String, Object> header : headers.entrySet()) {
return handleResponse(outcome, url, callback -> webldr.async().put(entity, callback));
}
- private WebTarget addQuery(WebTarget web, StringBuilder str, String separator, String name, String value) {
- str.append(separator);
- str.append(name);
+ private WebTarget addQuery(WebTarget web, StringBuilder str) {
+ str.append("?");
+ str.append("format");
str.append('=');
- str.append(value);
+ str.append("resource");
- return web.queryParam(name, value);
+ return web.queryParam("format", "resource");
}
/**
* 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.
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import org.onap.policy.aai.AaiConstants;
-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.controlloop.actorserviceprovider.OperationOutcome;
import org.onap.policy.controlloop.actorserviceprovider.OperationProperties;
import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOperationParams;
* 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.
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import org.onap.policy.aai.AaiConstants;
-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.controlloop.actorserviceprovider.OperationOutcome;
import org.onap.policy.controlloop.actorserviceprovider.OperationProperties;
import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOperationParams;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.Map;
-import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance;
import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
import org.onap.policy.controlloop.actor.test.BasicHttpOperation;
import org.onap.policy.simulators.Util;
<!--
============LICENSE_START=======================================================
Copyright (C) 2017-2020 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.
</dependency>
<dependency>
<groupId>org.onap.policy.common</groupId>
- <artifactId>policy-endpoints</artifactId>
+ <artifactId>message-bus</artifactId>
<version>${policy.common.version}</version>
<scope>provided</scope>
</dependency>
import org.onap.policy.appc.Response;
import org.onap.policy.appc.ResponseCode;
import org.onap.policy.appc.ResponseStatus;
-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.TopicSink;
+import org.onap.policy.common.message.bus.event.TopicSource;
import org.onap.policy.common.utils.coder.StandardCoderInstantAsMillis;
import org.onap.policy.common.utils.coder.StandardCoderObject;
import org.onap.policy.controlloop.actor.test.BasicBidirectionalTopicOperation;
<!--
============LICENSE_START=======================================================
Copyright (C) 2017-2018, 2020 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.
</dependency>
<dependency>
<groupId>org.onap.policy.common</groupId>
- <artifactId>policy-endpoints</artifactId>
+ <artifactId>message-bus</artifactId>
<version>${policy.common.version}</version>
<scope>provided</scope>
</dependency>
import org.onap.policy.appclcm.AppcLcmMessageWrapper;
import org.onap.policy.appclcm.AppcLcmOutput;
import org.onap.policy.appclcm.AppcLcmResponseStatus;
-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.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;
============LICENSE_START=======================================================
Copyright (C) 2019 Bell Canada. All rights reserved.
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.
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
- <artifactId>actor.aai</artifactId>
+ <groupId>org.onap.policy.models.policy-models-interactions</groupId>
+ <artifactId>simulators</artifactId>
<version>${project.version}</version>
- <scope>provided</scope>
+ <scope>test</scope>
</dependency>
<dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
- <artifactId>events</artifactId>
+ <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
+ <artifactId>actor.test</artifactId>
<version>${project.version}</version>
- <scope>provided</scope>
+ <scope>test</scope>
</dependency>
<dependency>
- <groupId>org.onap.policy.models.policy-models-interactions</groupId>
- <artifactId>simulators</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>common-parameters</artifactId>
+ <version>${policy.common.version}</version>
</dependency>
<dependency>
<groupId>org.onap.policy.common</groupId>
- <artifactId>policy-endpoints</artifactId>
+ <artifactId>utils</artifactId>
<version>${policy.common.version}</version>
- <scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
- <artifactId>aai</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>utils-test</artifactId>
+ <version>${policy.common.version}</version>
</dependency>
<dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
- <artifactId>actor.test</artifactId>
- <version>${project.version}</version>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
+ <artifactId>blueprint-proto</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.aai.schema-service</groupId>
+ <artifactId>aai-schema</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.google.protobuf</groupId>
+ <artifactId>protobuf-java</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.google.protobuf</groupId>
+ <artifactId>protobuf-java-util</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ </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>
</dependencies>
<!--
============LICENSE_START=======================================================
Copyright (C) 2018 Huawei Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2019-2020, 2023 Nordix Foundation.
+ Modifications Copyright (C) 2019-2020, 2023-2024 Nordix Foundation.
Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
<version>${policy.common.version}</version>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>message-bus</artifactId>
+ <version>${policy.common.version}</version>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
<artifactId>actor.test</artifactId>
* 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.
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
-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.controlloop.actorserviceprovider.OperationOutcome;
import org.onap.policy.controlloop.actorserviceprovider.impl.HttpOperation;
import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOperationParams;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertInstanceOf;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeoutException;
import org.mockito.Mockito;
-import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance;
import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
import org.onap.policy.controlloop.actor.test.BasicHttpOperation;
outcome = future2.get();
assertEquals(OperationResult.SUCCESS, outcome.getResult());
- assertTrue(outcome.getResponse() instanceof SdncResponse);
+ assertInstanceOf(SdncResponse.class, outcome.getResponse());
assertNotNull(outcome.getSubRequestId());
<!--
============LICENSE_START=======================================================
Copyright (C) 2018 Wipro Limited Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2019-2020, 2023 Nordix Foundation.
+ Modifications Copyright (C) 2019-2020, 2023-2024 Nordix Foundation.
Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
</dependency>
<dependency>
<groupId>org.onap.policy.common</groupId>
- <artifactId>policy-endpoints</artifactId>
+ <artifactId>capabilities</artifactId>
+ <version>${policy.common.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>message-bus</artifactId>
<version>${policy.common.version}</version>
<scope>provided</scope>
</dependency>
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeoutException;
import java.util.function.BiConsumer;
-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.TopicSink;
+import org.onap.policy.common.message.bus.event.TopicSource;
import org.onap.policy.common.utils.coder.StandardCoderObject;
import org.onap.policy.controlloop.actor.test.BasicBidirectionalTopicOperation;
import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
*
* @param listener listener to which to provide the response
* @param code response code
- * @param description response description
*/
- protected void provideResponse(BiConsumer<String, StandardCoderObject> listener, int code, String description) {
- PciResponse response = new PciResponse();
+ protected void provideResponse(BiConsumer<String, StandardCoderObject> listener, int code) {
+ PciResponse pciResponse = new PciResponse();
Status status = new Status();
- response.setStatus(status);
+ pciResponse.setStatus(status);
status.setCode(code);
- provideResponse(listener, Util.translate("", response, String.class));
+ provideResponse(listener, Util.translate("", pciResponse, String.class));
}
}
<!--
============LICENSE_START=======================================================
Copyright (C) 2017-2020 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.
<version>${policy.common.version}</version>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>message-bus</artifactId>
+ <version>${policy.common.version}</version>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
<artifactId>actor.test</artifactId>
* ONAP
* ================================================================================
* Copyright (C) 2022 CTC, Inc. and others. 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.
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
-import org.onap.policy.common.endpoints.event.comm.Topic;
-import org.onap.policy.common.endpoints.utils.NetLoggerUtil;
+import org.onap.policy.common.message.bus.event.Topic;
+import org.onap.policy.common.message.bus.utils.NetLoggerUtil;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
import org.onap.policy.controlloop.actorserviceprovider.OperationProperties;
* ================================================================================
* Copyright (C) 2020 Wipro Limited.
* Modifications Copyright (C) 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.
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
-import org.onap.policy.common.endpoints.event.comm.Topic;
-import org.onap.policy.common.endpoints.utils.NetLoggerUtil;
+import org.onap.policy.common.message.bus.event.Topic;
+import org.onap.policy.common.message.bus.utils.NetLoggerUtil;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
import org.onap.policy.controlloop.actorserviceprovider.OperationProperties;
* ================================================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2020 Wipro Limited.
- * 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.
import java.util.concurrent.CompletableFuture;
import org.apache.commons.lang3.tuple.Pair;
import org.onap.aai.domain.yang.ModelVer;
-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.controlloop.actorserviceprovider.OperationOutcome;
import org.onap.policy.controlloop.actorserviceprovider.OperationProperties;
import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOperationParams;
import java.util.concurrent.CompletableFuture;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Pair;
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
import org.onap.policy.common.endpoints.http.client.HttpClient;
-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.controlloop.actorserviceprovider.OperationOutcome;
import org.onap.policy.controlloop.actorserviceprovider.OperationProperties;
import org.onap.policy.controlloop.actorserviceprovider.parameters.ControlLoopOperationParams;
// @formatter:off
return handleResponse(outcome, url,
- callback -> delete(url, headers, MediaType.APPLICATION_JSON, strRequest, callback));
+ callback -> delete(url, headers, strRequest, callback));
// @formatter:on
}
* HttpClient, as the JerseyClient does not support it. This will add the content-type
* and authorization headers, so they should not be included within "headers".
*
- * @param uri URI suffix, to be appended to the URI prefix
- * @param headers headers to be included
- * @param contentType content type of the request
- * @param request request to be posted
+ * @param uri URI suffix, to be appended to the URI prefix
+ * @param headers headers to be included
+ * @param request request to be posted
* @param callback response callbacks
* @return a future to await the response. Note: it's untested whether canceling this
* future will actually cancel the underlying HTTP request
*/
- protected CompletableFuture<Response> delete(String uri, Map<String, Object> headers, String contentType,
- String request, InvocationCallback<Response> callback) {
+ protected CompletableFuture<Response> delete(String uri, Map<String, Object> headers,
+ String request, InvocationCallback<Response> callback) {
final String url = getClient().getBaseUrl() + uri;
var builder = HttpRequest.newBuilder(URI.create(url));
- builder = builder.header("Content-type", contentType);
+ builder = builder.header("Content-type", MediaType.APPLICATION_JSON);
builder = addAuthHeader(builder);
for (Entry<String, Object> header : headers.entrySet()) {
import java.util.List;
import java.util.Map;
import org.mockito.Mock;
-import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance;
import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
import org.onap.policy.controlloop.actor.test.BasicHttpOperation;
import org.onap.policy.controlloop.actorserviceprovider.TargetType;
import org.onap.policy.controlloop.actorserviceprovider.Util;
payload.put(SoOperation.REQ_PARAM_NM, Util.translate("", reqParams, String.class));
// config parameters
- List<Map<String, String>> config = new LinkedList<>();
- config.add(Collections.emptyMap());
- payload.put(SoOperation.CONFIG_PARAM_NM, Util.translate("", config, String.class));
+ List<Map<String, String>> configLinkedList = new LinkedList<>();
+ configLinkedList.add(Collections.emptyMap());
+ payload.put(SoOperation.CONFIG_PARAM_NM, Util.translate("", configLinkedList, String.class));
return payload;
}
String reqText = oper.prettyPrint(req);
final CompletableFuture<Response> delFuture =
- oper.delete("my-uri", headers, MediaType.APPLICATION_JSON, reqText, callback);
+ oper.delete("my-uri", headers, reqText, callback);
ArgumentCaptor<HttpRequest> reqCaptor = ArgumentCaptor.forClass(HttpRequest.class);
verify(javaClient).sendAsync(reqCaptor.capture(), any());
String reqText = oper.prettyPrint(req);
CompletableFuture<Response> delFuture =
- oper.delete("/my-uri", Map.of(), MediaType.APPLICATION_JSON, reqText, callback);
+ oper.delete("/my-uri", Map.of(), reqText, callback);
assertTrue(delFuture.isCompletedExceptionally());
<!--
============LICENSE_START=======================================================
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.
<dependencies>
<dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
- <artifactId>aai</artifactId>
+ <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
+ <artifactId>actorServiceProvider</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
- <artifactId>events</artifactId>
- <version>${project.version}</version>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>common-parameters</artifactId>
+ <version>${policy.common.version}</version>
</dependency>
<dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
- <artifactId>actorServiceProvider</artifactId>
- <version>${project.version}</version>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>policy-endpoints</artifactId>
+ <version>${policy.common.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>io.opentelemetry</groupId>
+ <artifactId>opentelemetry-context</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.kafka</groupId>
+ <artifactId>kafka-clients</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.onap.policy.common</groupId>
- <artifactId>policy-endpoints</artifactId>
+ <artifactId>message-bus</artifactId>
<version>${policy.common.version}</version>
- <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.onap.policy.models.policy-models-interactions</groupId>
<artifactId>utils-test</artifactId>
<version>${policy.common.version}</version>
</dependency>
+ <dependency>
+ <groupId>jakarta.ws.rs</groupId>
+ <artifactId>jakarta.ws.rs-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ </dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
import java.io.FileNotFoundException;
import java.util.Map;
import lombok.Getter;
-import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager;
-import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
import org.onap.policy.common.endpoints.http.client.HttpClientConfigException;
import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance;
-import org.onap.policy.common.endpoints.parameters.TopicParameterGroup;
+import org.onap.policy.common.message.bus.event.TopicEndpointManager;
import org.onap.policy.common.parameters.BeanValidationResult;
import org.onap.policy.common.parameters.BeanValidator;
import org.onap.policy.common.parameters.annotations.NotNull;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
+import org.onap.policy.common.parameters.topic.TopicParameterGroup;
import org.onap.policy.common.utils.coder.Coder;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardYamlCoder;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.Mock;
-import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager;
-import org.onap.policy.common.endpoints.event.comm.TopicSink;
-import org.onap.policy.common.endpoints.event.comm.TopicSource;
-import org.onap.policy.common.endpoints.event.comm.client.BidirectionalTopicClientException;
import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance;
import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
-import org.onap.policy.common.endpoints.parameters.TopicParameters;
+import org.onap.policy.common.message.bus.event.TopicEndpointManager;
+import org.onap.policy.common.message.bus.event.TopicSink;
+import org.onap.policy.common.message.bus.event.TopicSource;
+import org.onap.policy.common.message.bus.event.client.BidirectionalTopicClientException;
+import org.onap.policy.common.parameters.topic.TopicParameters;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoderObject;
import org.onap.policy.controlloop.actorserviceprovider.parameters.BidirectionalTopicConfig;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
-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.TopicSink;
+import org.onap.policy.common.message.bus.event.TopicSource;
import org.onap.policy.common.utils.coder.StandardCoderObject;
import org.onap.policy.simulators.TopicServer;
<version>${policy.common.version}</version>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>message-bus</artifactId>
+ <version>${policy.common.version}</version>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
<artifactId>actor.test</artifactId>
import static org.mockito.Mockito.lenient;
import org.mockito.Mock;
-import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance;
import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
import org.onap.policy.controlloop.actor.test.BasicHttpOperation;
import org.onap.policy.controlloop.actorserviceprovider.parameters.HttpPollingConfig;
import org.onap.policy.simulators.Util;
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.
<version>${policy.common.version}</version>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>message-bus</artifactId>
+ <version>${policy.common.version}</version>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
<artifactId>actor.test</artifactId>
* 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.
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
-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.controlloop.actorserviceprovider.CallbackManager;
import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
import org.onap.policy.controlloop.actorserviceprovider.impl.HttpOperation;
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.bus.internal.BusTopicParams;
import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance;
import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
import org.onap.policy.controlloop.actor.test.BasicHttpOperation;
import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
import org.onap.policy.controlloop.actorserviceprovider.OperationResult;
import org.onap.policy.models.decisions.concepts.DecisionResponse;
@ExtendWith(MockitoExtension.class)
- class ConfigureOperationTest extends BasicHttpOperation {
+class ConfigureOperationTest extends BasicHttpOperation {
@Mock
private Consumer<OperationOutcome> started;
* Starts the simulator.
*/
@BeforeAll
- static void setUpBeforeClass() throws Exception {
+ static void setUpBeforeClass() throws Exception {
org.onap.policy.simulators.Util.buildXacmlSim();
BusTopicParams clientParams = BusTopicParams.builder().clientName(MY_CLIENT).basePath("policy/pdpx/v1/")
- .hostname("localhost").managed(true).port(org.onap.policy.simulators.Util.XACMLSIM_SERVER_PORT)
- .build();
+ .hostname("localhost").managed(true).port(org.onap.policy.simulators.Util.XACMLSIM_SERVER_PORT)
+ .build();
HttpClientFactoryInstance.getClientFactory().build(clientParams);
}
@AfterAll
- static void tearDownAfterClass() {
+ static void tearDownAfterClass() {
HttpClientFactoryInstance.getClientFactory().destroy();
HttpServletServerFactoryInstance.getServerFactory().destroy();
}
* Sets up.
*/
@BeforeEach
- void setUp() {
+ void setUp() {
super.setUpBasic();
operConfig = mock(DecisionConfig.class);
}
@Test
- void testConstructor() {
+ void testConstructor() {
assertEquals(DEFAULT_ACTOR, oper.getActorName());
assertEquals(DEFAULT_OPERATION, oper.getName());
}
* Tests "success" case with simulator.
*/
@Test
- void testSuccess() throws Exception {
+ void testSuccess() throws Exception {
DecisionParams opParams =
- DecisionParams.builder().clientName(MY_CLIENT).path("decision").action("configure").build();
+ DecisionParams.builder().clientName(MY_CLIENT).path("decision").action("configure").build();
config = new DecisionConfig(blockingExecutor, opParams, HttpClientFactoryInstance.getClientFactory());
params = params.toBuilder().payload(Map.of("policy-id", "test-policy")).retry(0).timeoutSec(5)
- .executor(blockingExecutor).build();
+ .executor(blockingExecutor).build();
oper = new ConfigureOperation(params, config);
outcome = oper.start().get();
* Tests "failure" case with simulator.
*/
@Test
- void testFailure() throws Exception {
+ void testFailure() throws Exception {
DecisionParams opParams =
- DecisionParams.builder().clientName(MY_CLIENT).path("decision").action("configure").build();
+ DecisionParams.builder().clientName(MY_CLIENT).path("decision").action("configure").build();
config = new DecisionConfig(blockingExecutor, opParams, HttpClientFactoryInstance.getClientFactory());
params = params.toBuilder().payload(Map.of("policy-id", "nonexistent")).retry(0).timeoutSec(5)
- .executor(blockingExecutor).build();
+ .executor(blockingExecutor).build();
oper = new ConfigureOperation(params, config);
outcome = oper.start().get();
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.jupiter.MockitoExtension;
-import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance;
import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
import org.onap.policy.controlloop.actor.test.BasicHttpOperation;
import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
import org.onap.policy.controlloop.actorserviceprovider.OperationResult;
import org.onap.policy.simulators.XacmlSimulatorJaxRs;
@ExtendWith(MockitoExtension.class)
- class DecisionOperationTest extends BasicHttpOperation {
+class DecisionOperationTest extends BasicHttpOperation {
private static final List<String> PROPERTY_NAMES = List.of("prop-A", "prop-B");
@Mock
* Starts the simulator.
*/
@BeforeAll
- static void setUpBeforeClass() throws Exception {
+ static void setUpBeforeClass() throws Exception {
org.onap.policy.simulators.Util.buildXacmlSim();
BusTopicParams clientParams = BusTopicParams.builder().clientName(MY_CLIENT).basePath("policy/pdpx/v1/")
- .hostname("localhost").managed(true).port(org.onap.policy.simulators.Util.XACMLSIM_SERVER_PORT)
- .build();
+ .hostname("localhost").managed(true).port(org.onap.policy.simulators.Util.XACMLSIM_SERVER_PORT)
+ .build();
HttpClientFactoryInstance.getClientFactory().build(clientParams);
}
@AfterAll
- static void tearDownAfterClass() {
+ static void tearDownAfterClass() {
HttpClientFactoryInstance.getClientFactory().destroy();
HttpServletServerFactoryInstance.getServerFactory().destroy();
}
* Sets up.
*/
@BeforeEach
- void setUp() {
+ void setUp() {
super.setUpBasic();
guardConfig = mock(DecisionConfig.class);
* Tests with simulator.
*/
@Test
- void testSimulator() throws Exception {
+ void testSimulator() throws Exception {
DecisionParams opParams = DecisionParams.builder().clientName(MY_CLIENT).path("decision").build();
config = new DecisionConfig(blockingExecutor, opParams, HttpClientFactoryInstance.getClientFactory());
params = params.toBuilder().retry(0).timeoutSec(5).executor(blockingExecutor)
- .payload(Map.of("clname", XacmlSimulatorJaxRs.DENY_CLNAME)).build();
+ .payload(Map.of("clname", XacmlSimulatorJaxRs.DENY_CLNAME)).build();
oper = new MyOper(params, config);
outcome = oper.start().get();
}
@Test
- void testConstructor() {
+ void testConstructor() {
assertEquals(DEFAULT_ACTOR, oper.getActorName());
assertEquals(DEFAULT_OPERATION, oper.getName());
}
@Test
- void testGetPropertyNames() {
+ void testGetPropertyNames() {
assertThat(oper.getPropertyNames()).isEqualTo(PROPERTY_NAMES);
}
@Test
- void testStartOperationAsync() throws Exception {
+ void testStartOperationAsync() throws Exception {
CompletableFuture<OperationOutcome> future2 = oper.start();
executor.runAll(100);
assertFalse(future2.isDone());
* Tests startOperationAsync() when the guard is disabled.
*/
@Test
- void testStartOperationAsyncDisabled() throws Exception {
+ void testStartOperationAsyncDisabled() throws Exception {
// indicate that it's disabled
when(guardConfig.isDisabled()).thenReturn(true);
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.jupiter.MockitoExtension;
-import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance;
import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.controlloop.actor.test.BasicHttpOperation;
import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
import org.onap.policy.simulators.XacmlSimulatorJaxRs;
@ExtendWith(MockitoExtension.class)
- class GuardOperationTest extends BasicHttpOperation {
+class GuardOperationTest extends BasicHttpOperation {
@Mock
private Consumer<OperationOutcome> started;
* Starts the simulator.
*/
@BeforeAll
- static void setUpBeforeClass() throws Exception {
+ static void setUpBeforeClass() throws Exception {
org.onap.policy.simulators.Util.buildXacmlSim();
BusTopicParams clientParams = BusTopicParams.builder().clientName(MY_CLIENT).basePath("policy/pdpx/v1/")
- .hostname("localhost").managed(true).port(org.onap.policy.simulators.Util.XACMLSIM_SERVER_PORT)
- .build();
+ .hostname("localhost").managed(true).port(org.onap.policy.simulators.Util.XACMLSIM_SERVER_PORT)
+ .build();
HttpClientFactoryInstance.getClientFactory().build(clientParams);
}
@AfterAll
- static void tearDownAfterClass() {
+ static void tearDownAfterClass() {
HttpClientFactoryInstance.getClientFactory().destroy();
HttpServletServerFactoryInstance.getServerFactory().destroy();
}
* Sets up.
*/
@BeforeEach
- void setUp() {
+ void setUp() {
super.setUpBasic();
guardConfig = mock(DecisionConfig.class);
* Tests "success" case with simulator.
*/
@Test
- void testSuccess() throws Exception {
+ void testSuccess() throws Exception {
DecisionParams opParams =
- DecisionParams.builder().clientName(MY_CLIENT).path("decision").action("guard").build();
+ DecisionParams.builder().clientName(MY_CLIENT).path("decision").action("guard").build();
config = new DecisionConfig(blockingExecutor, opParams, HttpClientFactoryInstance.getClientFactory());
params = params.toBuilder().retry(0).timeoutSec(5).executor(blockingExecutor).build();
* Tests "failure" case with simulator.
*/
@Test
- void testFailure() throws Exception {
+ void testFailure() throws Exception {
DecisionParams opParams =
- DecisionParams.builder().clientName(MY_CLIENT).path("decision").action("guard").build();
+ DecisionParams.builder().clientName(MY_CLIENT).path("decision").action("guard").build();
config = new DecisionConfig(blockingExecutor, opParams, HttpClientFactoryInstance.getClientFactory());
params = params.toBuilder().retry(0).timeoutSec(5).executor(blockingExecutor)
- .payload(Map.of("clname", XacmlSimulatorJaxRs.DENY_CLNAME)).build();
+ .payload(Map.of("clname", XacmlSimulatorJaxRs.DENY_CLNAME)).build();
oper = new GuardOperation(params, config);
outcome = oper.start().get();
}
@Test
- void testConstructor() {
+ void testConstructor() {
assertEquals(DEFAULT_ACTOR, oper.getActorName());
assertEquals(DEFAULT_OPERATION, oper.getName());
}
@Test
- void testGetPropertyNames() {
+ void testGetPropertyNames() {
assertThat(oper.getPropertyNames()).isEmpty();
}
@Test
- void testMakeRequest() throws CoderException {
+ void testMakeRequest() throws CoderException {
oper.generateSubRequestId(2);
verifyPayload("makeReqStd.json", makePayload());
}
@Test
- void testPostProcessResponse() {
+ void testPostProcessResponse() {
DecisionResponse response = new DecisionResponse();
// null status
<dependencies>
<dependency>
<groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
- <artifactId>aai</artifactId>
+ <artifactId>events</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
- <artifactId>events</artifactId>
- <version>${project.version}</version>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>capabilities</artifactId>
+ <version>${policy.common.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>common-parameters</artifactId>
+ <version>${policy.common.version}</version>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>gson</artifactId>
+ <version>${policy.common.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>utils</artifactId>
+ <version>${policy.common.version}</version>
+ </dependency>
<dependency>
<groupId>org.onap.policy.common</groupId>
<artifactId>policy-endpoints</artifactId>
<version>${policy.common.version}</version>
<scope>provided</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>io.opentelemetry</groupId>
+ <artifactId>opentelemetry-context</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.kafka</groupId>
+ <artifactId>kafka-clients</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>message-bus</artifactId>
+ <version>${policy.common.version}</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.onap.policy.common</groupId>
<artifactId>utils-test</artifactId>
<version>${policy.common.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.ws.rs</groupId>
+ <artifactId>jakarta.ws.rs-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
* ONAP
* ================================================================================
* Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;
import org.apache.commons.lang3.tuple.Pair;
-import org.onap.policy.common.endpoints.event.comm.client.BidirectionalTopicClientException;
+import org.onap.policy.common.message.bus.event.client.BidirectionalTopicClientException;
import org.onap.policy.controlloop.actorserviceprovider.Util;
import org.onap.policy.controlloop.actorserviceprovider.parameters.BidirectionalTopicActorParams;
import org.onap.policy.controlloop.actorserviceprovider.parameters.BidirectionalTopicParams;
* ONAP
* ================================================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import java.util.concurrent.CompletableFuture;
import java.util.function.BiConsumer;
import lombok.Getter;
-import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType;
+import org.onap.policy.common.message.bus.utils.NetLoggerUtil.EventType;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoderObject;
import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
* 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.
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import lombok.Getter;
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
import org.onap.policy.common.endpoints.http.client.HttpClient;
-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.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.utils.NetLoggerUtil;
+import org.onap.policy.common.message.bus.utils.NetLoggerUtil.EventType;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
import org.onap.policy.controlloop.actorserviceprovider.OperationResult;
* ONAP
* ================================================================================
* Copyright (C) 2020-2022 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.
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
-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.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.utils.NetLoggerUtil;
+import org.onap.policy.common.message.bus.utils.NetLoggerUtil.EventType;
import org.onap.policy.common.utils.coder.Coder;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
* ONAP
* ================================================================================
* Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
package org.onap.policy.controlloop.actorserviceprovider.topic;
import java.util.List;
-import org.onap.policy.common.endpoints.event.comm.client.BidirectionalTopicClient;
-import org.onap.policy.common.endpoints.event.comm.client.BidirectionalTopicClientException;
+import org.onap.policy.common.message.bus.event.client.BidirectionalTopicClient;
+import org.onap.policy.common.message.bus.event.client.BidirectionalTopicClientException;
/**
* Handler for a bidirectional topic, supporting both publishing and forwarding of
* ONAP
* ================================================================================
* Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
-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.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
import org.onap.policy.common.utils.coder.StandardCoderObject;
import org.slf4j.LoggerFactory;
/**
- * A topic listener. When a message arrives on a topic, it is forwarded to listeners based
+ * A topic listener. When a message arrives at a topic, it is forwarded to listeners based
* on the content of fields found within the message. However, depending on the message
* type, the relevant fields might be found in different places within the message's
* object hierarchy. For each different list of keys, this class maintains a
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.TopicEndpointManager;
-import org.onap.policy.common.endpoints.event.comm.client.BidirectionalTopicClientException;
+import org.onap.policy.common.message.bus.event.TopicEndpointManager;
+import org.onap.policy.common.message.bus.event.client.BidirectionalTopicClientException;
import org.onap.policy.controlloop.actorserviceprovider.Util;
import org.onap.policy.controlloop.actorserviceprovider.parameters.BidirectionalTopicActorParams;
import org.onap.policy.controlloop.actorserviceprovider.parameters.ParameterValidationRuntimeException;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.jupiter.MockitoExtension;
-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;
CompletableFuture<OperationOutcome> future = oper.startOperationAsync(1, outcome);
assertFalse(future.isDone());
- verify(forwarder).register(eq(Arrays.asList(REQ_ID)), listenerCaptor.capture());
+ verify(forwarder).register(eq(List.of(REQ_ID)), listenerCaptor.capture());
verify(forwarder, never()).unregister(any(), any());
assertEquals(OperationResult.SUCCESS, outcome.getResult());
assertEquals(response, outcome.getResponse());
- verify(forwarder).unregister(Arrays.asList(REQ_ID), listenerCaptor.getValue());
+ verify(forwarder).unregister(List.of(REQ_ID), listenerCaptor.getValue());
}
/**
CompletableFuture<OperationOutcome> future = oper.startOperationAsync(1, outcome);
assertFalse(future.isDone());
- verify(forwarder).register(eq(Arrays.asList(REQ_ID)), listenerCaptor.capture());
+ verify(forwarder).register(eq(List.of(REQ_ID)), listenerCaptor.capture());
verify(forwarder, never()).unregister(any(), any());
assertTrue(executor.runAll(MAX_REQUESTS));
assertTrue(future.isCompletedExceptionally());
- verify(forwarder).unregister(Arrays.asList(REQ_ID), listenerCaptor.getValue());
+ verify(forwarder).unregister(List.of(REQ_ID), listenerCaptor.getValue());
}
/**
assertThatIllegalStateException().isThrownBy(() -> oper.startOperationAsync(1, outcome));
- verify(forwarder).register(eq(Arrays.asList(REQ_ID)), listenerCaptor.capture());
+ verify(forwarder).register(eq(List.of(REQ_ID)), listenerCaptor.capture());
// must still unregister
- verify(forwarder).unregister(Arrays.asList(REQ_ID), listenerCaptor.getValue());
+ verify(forwarder).unregister(List.of(REQ_ID), listenerCaptor.getValue());
}
@Test
}
- private class MyStringOperation extends BidirectionalTopicOperation<String, String> {
+ private static class MyStringOperation extends BidirectionalTopicOperation<String, String> {
MyStringOperation(ControlLoopOperationParams params, BidirectionalTopicConfig config) {
super(params, config, String.class, Collections.emptyList());
@Override
protected List<String> getExpectedKeyValues(int attempt, String request) {
- return Arrays.asList(REQ_ID);
+ return List.of(REQ_ID);
}
@Override
}
- private class MyScoOperation extends BidirectionalTopicOperation<MyRequest, StandardCoderObject> {
+ private static class MyScoOperation extends BidirectionalTopicOperation<MyRequest, StandardCoderObject> {
MyScoOperation(ControlLoopOperationParams params, BidirectionalTopicConfig config) {
super(params, config, StandardCoderObject.class, Collections.emptyList());
}
@Override
protected List<String> getExpectedKeyValues(int attempt, MyRequest request) {
- return Arrays.asList(REQ_ID);
+ return List.of(REQ_ID);
}
@Override
@Override
protected List<String> getExpectedKeyValues(int attempt, MyRequest request) {
- return Arrays.asList(REQ_ID);
+ return List.of(REQ_ID);
}
@Override
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertInstanceOf;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.jupiter.MockitoExtension;
-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.endpoints.event.comm.bus.internal.BusTopicParams.TopicParamsBuilder;
import org.onap.policy.common.endpoints.http.client.HttpClient;
import org.onap.policy.common.endpoints.http.client.HttpClientFactory;
import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance;
import org.onap.policy.common.endpoints.http.server.HttpServletServer;
import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
-import org.onap.policy.common.endpoints.utils.NetLoggerUtil.EventType;
import org.onap.policy.common.gson.GsonMessageBodyHandler;
-import org.onap.policy.common.utils.coder.CoderException;
+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.parameters.topic.BusTopicParams;
+import org.onap.policy.common.parameters.topic.BusTopicParams.TopicParamsBuilder;
import org.onap.policy.common.utils.network.NetworkUtil;
import org.onap.policy.controlloop.actorserviceprovider.OperationOutcome;
import org.onap.policy.controlloop.actorserviceprovider.OperationResult;
@Mock
private Executor executor;
- private ControlLoopOperationParams params;
- private OperationOutcome outcome;
+ private ControlLoopOperationParams operationParams;
+ private OperationOutcome operationOutcome;
private AtomicReference<InvocationCallback<Response>> callback;
private Future<Response> future;
private HttpConfig config;
* Starts the simulator.
*/
@BeforeAll
- void setUpBeforeClass() throws Exception {
+ void setUpBeforeClass() throws Exception {
// allocate a port
int port = NetworkUtil.allocPort();
* Start the simulator. Must use "Properties" to configure it, otherwise the
* server will use the wrong serialization provider.
*/
- Properties svrprops = getServerProperties("my-server", port);
+ Properties svrprops = getServerProperties(port);
HttpServletServerFactoryInstance.getServerFactory().build(svrprops).forEach(HttpServletServer::start);
if (!NetworkUtil.isTcpPortOpen("localhost", port, 100, 100)) {
HttpClientFactoryInstance.getClientFactory().build(builder.clientName(HTTP_CLIENT).port(port).build());
HttpClientFactoryInstance.getClientFactory()
- .build(builder.clientName(HTTP_NO_SERVER).port(NetworkUtil.allocPort()).build());
+ .build(builder.clientName(HTTP_NO_SERVER).port(NetworkUtil.allocPort()).build());
}
/**
* Destroys the Http factories and stops the appender.
*/
@AfterAll
- static void tearDownAfterClass() {
+ static void tearDownAfterClass() {
HttpClientFactoryInstance.getClientFactory().destroy();
HttpServletServerFactoryInstance.getServerFactory().destroy();
}
* the REST server.
*/
@BeforeEach
- void setUp() {
+ void setUp() {
rejectRequest = false;
nget = 0;
npost = 0;
Mockito.lenient().when(response.readEntity(String.class)).thenReturn(TEXT);
Mockito.lenient().when(response.getStatus()).thenReturn(200);
- params = ControlLoopOperationParams.builder().actor(ACTOR).operation(OPERATION).requestId(REQ_ID).build();
+ operationParams = ControlLoopOperationParams.builder().actor(ACTOR)
+ .operation(OPERATION).requestId(REQ_ID).build();
- outcome = params.makeOutcome();
+ operationOutcome = operationParams.makeOutcome();
callback = new AtomicReference<>();
future = new CompletableFuture<>();
Mockito.lenient().when(clientFactory.get(any())).thenReturn(client);
- initConfig(HTTP_CLIENT);
+ initConfig();
oper = new MyGetOperation<>(String.class);
}
@Test
- void testHttpOperator() {
+ void testHttpOperator() {
assertEquals(ACTOR, oper.getActorName());
assertEquals(OPERATION, oper.getName());
assertEquals(ACTOR + "." + OPERATION, oper.getFullName());
}
@Test
- void testMakeHeaders() {
+ void testMakeHeaders() {
assertEquals(Collections.emptyMap(), oper.makeHeaders());
}
@Test
- void testGetPath() {
+ void testGetPath() {
assertEquals(PATH, oper.getPath());
}
@Test
- void testMakeUrl() {
+ void testMakeUrl() {
// use a real client
- initRealConfig(HTTP_CLIENT);
+ initRealConfig();
oper = new MyGetOperation<>(String.class);
}
@Test
- void testDoConfigureMapOfStringObject_testGetClient_testGetPath_testGetTimeoutMs() {
+ void testDoConfigureMapOfStringObject_testGetClient_testGetPath_testGetTimeoutMs() {
// use value from operator
assertEquals(1000L, oper.getTimeoutMs(null));
* Tests handleResponse() when it completes.
*/
@Test
- void testHandleResponseComplete() throws Exception {
- CompletableFuture<OperationOutcome> future2 = oper.handleResponse(outcome, PATH, cb -> {
+ void testHandleResponseComplete() throws Exception {
+ CompletableFuture<OperationOutcome> future2 = oper.handleResponse(operationOutcome, PATH, cb -> {
callback.set(cb);
return future;
});
assertNotNull(callback.get());
callback.get().completed(response);
- assertSame(outcome, future2.get(5, TimeUnit.SECONDS));
- assertSame(TEXT, outcome.getResponse());
+ assertSame(operationOutcome, future2.get(5, TimeUnit.SECONDS));
+ assertSame(TEXT, operationOutcome.getResponse());
- assertEquals(OperationResult.SUCCESS, outcome.getResult());
+ assertEquals(OperationResult.SUCCESS, operationOutcome.getResult());
}
/**
* Tests handleResponse() when it fails.
*/
@Test
- void testHandleResponseFailed() {
- CompletableFuture<OperationOutcome> future2 = oper.handleResponse(outcome, PATH, cb -> {
+ void testHandleResponseFailed() {
+ CompletableFuture<OperationOutcome> future2 = oper.handleResponse(operationOutcome, PATH, cb -> {
callback.set(cb);
return future;
});
*/
@Test
void testProcessResponseSuccessString() throws Exception {
- CompletableFuture<OperationOutcome> result = oper.processResponse(outcome, PATH, response);
+ CompletableFuture<OperationOutcome> result = oper.processResponse(operationOutcome, PATH, response);
assertTrue(result.isDone());
- assertSame(outcome, result.get());
- assertEquals(OperationResult.SUCCESS, outcome.getResult());
- assertSame(TEXT, outcome.getResponse());
+ assertSame(operationOutcome, result.get());
+ assertEquals(OperationResult.SUCCESS, operationOutcome.getResult());
+ assertSame(TEXT, operationOutcome.getResponse());
}
/**
@Test
void testProcessResponseFailure() throws Exception {
when(response.getStatus()).thenReturn(555);
- CompletableFuture<OperationOutcome> result = oper.processResponse(outcome, PATH, response);
+ CompletableFuture<OperationOutcome> result = oper.processResponse(operationOutcome, PATH, response);
assertTrue(result.isDone());
- assertSame(outcome, result.get());
- assertEquals(OperationResult.FAILURE, outcome.getResult());
- assertSame(TEXT, outcome.getResponse());
+ assertSame(operationOutcome, result.get());
+ assertEquals(OperationResult.FAILURE, operationOutcome.getResult());
+ assertSame(TEXT, operationOutcome.getResponse());
}
/**
MyGetOperation<Integer> oper2 = new MyGetOperation<>(Integer.class);
- CompletableFuture<OperationOutcome> result = oper2.processResponse(outcome, PATH, response);
+ CompletableFuture<OperationOutcome> result = oper2.processResponse(operationOutcome, PATH, response);
assertTrue(result.isDone());
- assertSame(outcome, result.get());
- assertEquals(OperationResult.SUCCESS, outcome.getResult());
- assertEquals(Integer.valueOf(10), outcome.getResponse());
+ assertSame(operationOutcome, result.get());
+ assertEquals(OperationResult.SUCCESS, operationOutcome.getResult());
+ assertEquals(Integer.valueOf(10), operationOutcome.getResponse());
}
/**
void testProcessResponseDecodeExcept() {
MyGetOperation<Integer> oper2 = new MyGetOperation<>(Integer.class);
- assertThatIllegalArgumentException().isThrownBy(() -> oper2.processResponse(outcome, PATH, response));
+ assertThatIllegalArgumentException().isThrownBy(() -> oper2.processResponse(operationOutcome, PATH, response));
}
@Test
void testPostProcessResponse() {
- assertThatCode(() -> oper.postProcessResponse(outcome, PATH, null, null)).doesNotThrowAnyException();
+ assertThatCode(() -> oper.postProcessResponse(operationOutcome, PATH, null, null)).doesNotThrowAnyException();
}
@Test
@Test
void testGet() throws Exception {
// use a real client
- initRealConfig(HTTP_CLIENT);
+ initRealConfig();
MyGetOperation<MyResponse> oper2 = new MyGetOperation<>(MyResponse.class);
assertNotNull(outcome);
assertEquals(1, nget);
assertEquals(OperationResult.SUCCESS, outcome.getResult());
- assertTrue(outcome.getResponse() instanceof MyResponse);
+ assertInstanceOf(MyResponse.class, outcome.getResponse());
}
/**
@Test
void testDelete() throws Exception {
// use a real client
- initRealConfig(HTTP_CLIENT);
+ initRealConfig();
MyDeleteOperation oper2 = new MyDeleteOperation();
assertNotNull(outcome);
assertEquals(1, ndelete);
assertEquals(OperationResult.SUCCESS, outcome.getResult());
- assertTrue(outcome.getResponse() instanceof String);
+ assertInstanceOf(String.class, outcome.getResponse());
}
/**
@Test
void testPost() throws Exception {
// use a real client
- initRealConfig(HTTP_CLIENT);
+ initRealConfig();
MyPostOperation oper2 = new MyPostOperation();
OperationOutcome outcome = runOperation(oper2);
assertNotNull(outcome);
assertEquals(1, npost);
assertEquals(OperationResult.SUCCESS, outcome.getResult());
- assertTrue(outcome.getResponse() instanceof MyResponse);
+ assertInstanceOf(MyResponse.class, outcome.getResponse());
}
/**
@Test
void testPut() throws Exception {
// use a real client
- initRealConfig(HTTP_CLIENT);
+ initRealConfig();
MyPutOperation oper2 = new MyPutOperation();
assertNotNull(outcome);
assertEquals(1, nput);
assertEquals(OperationResult.SUCCESS, outcome.getResult());
- assertTrue(outcome.getResponse() instanceof MyResponse);
+ assertInstanceOf(MyResponse.class, outcome.getResponse());
}
@Test
/**
* Gets server properties.
*
- * @param name server name
* @param port server port
* @return server properties
*/
- private static Properties getServerProperties(String name, int port) {
+ private static Properties getServerProperties(int port) {
final Properties props = new Properties();
- props.setProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES, name);
+ props.setProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES, "my-server");
- final String svcpfx = PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + name;
+ final String svcpfx = PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + "my-server";
props.setProperty(svcpfx + PolicyEndPointProperties.PROPERTY_HTTP_REST_CLASSES_SUFFIX, Server.class.getName());
props.setProperty(svcpfx + PolicyEndPointProperties.PROPERTY_HTTP_HOST_SUFFIX, "localhost");
props.setProperty(svcpfx + PolicyEndPointProperties.PROPERTY_HTTP_SWAGGER_SUFFIX, "false");
props.setProperty(svcpfx + PolicyEndPointProperties.PROPERTY_HTTP_SERIALIZATION_PROVIDER,
- GsonMessageBodyHandler.class.getName());
+ GsonMessageBodyHandler.class.getName());
return props;
}
/**
* Initializes the configuration.
- *
- * @param clientName name of the client which it should use
*/
- private void initConfig(String clientName) {
- initConfig(clientName, clientFactory);
+ private void initConfig() {
+ initConfig(clientFactory);
}
/**
* Initializes the configuration with a real client.
- *
- * @param clientName name of the client which it should use
*/
- private void initConfig(String clientName, HttpClientFactory factory) {
- HttpParams params = HttpParams.builder().clientName(clientName).path(PATH).timeoutSec(1).build();
+ private void initConfig(HttpClientFactory factory) {
+ HttpParams params = HttpParams.builder().clientName(HttpOperationTest.HTTP_CLIENT)
+ .path(PATH).timeoutSec(1).build();
config = new HttpConfig(executor, params, factory);
}
/**
* Initializes the configuration with a real client.
- *
- * @param clientName name of the client which it should use
*/
- private void initRealConfig(String clientName) {
- initConfig(clientName, HttpClientFactoryInstance.getClientFactory());
+ private void initRealConfig() {
+ initConfig(HttpClientFactoryInstance.getClientFactory());
}
/**
* Runs the operation.
*
* @param operator operator on which to start the operation
- * @return the outcome of the operation, or {@code null} if it does not complete in
- * time
+ * @return the outcome of the operation, or {@code null} if it does not complete in time
*/
private <T> OperationOutcome runOperation(HttpOperation<T> operator)
- throws InterruptedException, ExecutionException, TimeoutException {
+ throws InterruptedException, ExecutionException, TimeoutException {
- CompletableFuture<OperationOutcome> future = operator.start();
+ CompletableFuture<OperationOutcome> completableFuture = operator.start();
- return future.get(5, TimeUnit.SECONDS);
+ return completableFuture.get(5, TimeUnit.SECONDS);
}
@Getter
private class MyGetOperation<T> extends HttpOperation<T> {
MyGetOperation(Class<T> responseClass) {
- super(HttpOperationTest.this.params, HttpOperationTest.this.config, responseClass, Collections.emptyList());
+ super(HttpOperationTest.this.operationParams, HttpOperationTest.this.config,
+ responseClass, Collections.emptyList());
}
@Override
// @formatter:off
return handleResponse(outcome, url,
- callback -> getClient().get(callback, getPath(), headers));
+ invocationCallback -> getClient().get(invocationCallback, getPath(), headers));
// @formatter:on
}
}
private class MyPostOperation extends HttpOperation<MyResponse> {
MyPostOperation() {
- super(HttpOperationTest.this.params, HttpOperationTest.this.config, MyResponse.class,
- Collections.emptyList());
+ super(HttpOperationTest.this.operationParams, HttpOperationTest.this.config, MyResponse.class,
+ Collections.emptyList());
}
@Override
// @formatter:off
return handleResponse(outcome, url,
- callback -> getClient().post(callback, getPath(), entity, headers));
+ invocationCallback -> getClient().post(invocationCallback, getPath(), entity, headers));
// @formatter:on
}
}
private class MyPutOperation extends HttpOperation<MyResponse> {
MyPutOperation() {
- super(HttpOperationTest.this.params, HttpOperationTest.this.config, MyResponse.class,
- Collections.emptyList());
+ super(HttpOperationTest.this.operationParams, HttpOperationTest.this.config, MyResponse.class,
+ Collections.emptyList());
}
@Override
// @formatter:off
return handleResponse(outcome, url,
- callback -> getClient().put(callback, getPath(), entity, headers));
+ invocationCallback -> getClient().put(invocationCallback, getPath(), entity, headers));
// @formatter:on
}
}
private class MyDeleteOperation extends HttpOperation<String> {
MyDeleteOperation() {
- super(HttpOperationTest.this.params, HttpOperationTest.this.config, String.class, Collections.emptyList());
+ super(HttpOperationTest.this.operationParams, HttpOperationTest.this.config,
+ String.class, Collections.emptyList());
}
@Override
// @formatter:off
return handleResponse(outcome, url,
- callback -> getClient().delete(callback, getPath(), headers));
+ invocationCallback -> getClient().delete(invocationCallback, getPath(), headers));
// @formatter:on
}
}
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.onap.policy.common.utils.coder.Coder;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
* @param expectedCallbacks number of callbacks expected
* @param expectedOperations number of operation invocations expected
* @param expectedResult expected outcome
- * @param manipulator function to modify the future returned by
- * {@link OperationPartial#start(ControlLoopOperationParams)} before the tasks
- * in the executor are run
+ * @param manipulator function to modify the future returned before the tasks in the executor are run
*/
private void verifyRun(String testName, int expectedCallbacks, int expectedOperations,
OperationResult expectedResult, Consumer<CompletableFuture<OperationOutcome>> manipulator) {
import static org.mockito.Mockito.when;
import java.util.Arrays;
+import java.util.List;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
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.event.comm.TopicEndpoint;
-import org.onap.policy.common.endpoints.event.comm.TopicSink;
-import org.onap.policy.common.endpoints.event.comm.TopicSource;
-import org.onap.policy.common.endpoints.event.comm.client.BidirectionalTopicClientException;
+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.TopicSink;
+import org.onap.policy.common.message.bus.event.TopicSource;
+import org.onap.policy.common.message.bus.event.client.BidirectionalTopicClientException;
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
@ExtendWith(MockitoExtension.class)
*/
@BeforeEach
void setUp() throws BidirectionalTopicClientException {
- when(mgr.getTopicSinks(MY_SINK)).thenReturn(Arrays.asList(publisher));
- when(mgr.getTopicSources(Arrays.asList(MY_SOURCE))).thenReturn(Arrays.asList(subscriber));
+ when(mgr.getTopicSinks(MY_SINK)).thenReturn(List.of(publisher));
+ when(mgr.getTopicSources(List.of(MY_SOURCE))).thenReturn(List.of(subscriber));
when(publisher.getTopicCommInfrastructure()).thenReturn(CommInfrastructure.NOOP);
import static org.mockito.Mockito.verify;
import java.util.Arrays;
+import java.util.List;
import java.util.Map;
import java.util.function.BiConsumer;
import org.junit.jupiter.api.BeforeEach;
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.message.bus.event.Topic.CommInfrastructure;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
import org.onap.policy.common.utils.coder.StandardCoderObject;
assertNotNull(forwarder2);
assertNotSame(forwarder1, forwarder2);
- forwarder1.register(Arrays.asList(VALUEA_REQID), listener1);
- forwarder1.register(Arrays.asList(VALUEB_REQID), listener1b);
+ forwarder1.register(List.of(VALUEA_REQID), listener1);
+ forwarder1.register(List.of(VALUEB_REQID), listener1b);
forwarder2.register(Arrays.asList(VALUEA_REQID, VALUEA_SUBREQID), listener2);
}
<artifactId>aai</artifactId>
<dependencies>
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.json</groupId>
- <artifactId>json</artifactId>
- </dependency>
<dependency>
<groupId>org.onap.policy.common</groupId>
<artifactId>utils</artifactId>
</dependency>
<dependency>
<groupId>org.onap.policy.common</groupId>
- <artifactId>policy-endpoints</artifactId>
+ <artifactId>message-bus</artifactId>
<version>${policy.common.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.onap.aai.schema-service</groupId>
<artifactId>aai-schema</artifactId>
- <version>1.12.3</version>
- <exclusions>
- <exclusion>
- <groupId>com.google.code.javaparser</groupId>
- <artifactId>javaparser</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.googlecode.json-simple</groupId>
- <artifactId>json-simple</artifactId>
- </exclusion>
- </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.3.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.json</groupId>
+ <artifactId>json</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
import org.apache.commons.lang3.tuple.Pair;
import org.json.JSONArray;
import org.json.JSONObject;
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
-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.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.utils.NetLoggerUtil;
+import org.onap.policy.common.message.bus.utils.NetLoggerUtil.EventType;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
import org.onap.policy.rest.RestManager;
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>com.openpojo</groupId>
+ <artifactId>openpojo</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
<description>gRPC client implementation to send process message to CDS blueprint processor gRPC endpoint.
</description>
- <properties>
- <grpc.version>1.29.0</grpc.version>
- </properties>
-
<dependencies>
<!-- CDS dependencies -->
<dependency>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
<artifactId>blueprint-proto</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-stub</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-netty</artifactId>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-testing</artifactId>
- <version>${grpc.version}</version>
- <scope>test</scope>
</dependency>
<!-- Policy dependencies -->
</dependency>
<dependency>
<groupId>org.onap.policy.common</groupId>
- <artifactId>policy-endpoints</artifactId>
+ <artifactId>message-bus</artifactId>
<version>${policy.common.version}</version>
</dependency>
<dependency>
- <groupId>org.onap.policy.common</groupId>
- <artifactId>utils</artifactId>
- <version>${policy.common.version}</version>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
/*-
- * ============LICENSE_START=======================================================
+ * ============LICENSE_START=============================================================
* Copyright (C) 2019-2021 Bell Canada.
* Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
+ * Modifications Copyright (C) 2024 Nordix Foundation.
+ * ======================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput;
import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput;
import org.onap.policy.cds.api.CdsProcessorListener;
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
-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.Topic.CommInfrastructure;
+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;
@Override
public void onError(Throwable throwable) {
LOGGER.info(LOG_MSG, EventType.IN, CommInfrastructure.REST, url, NetLoggerUtil.SYSTEM_LS,
- throwable);
+ throwable.getMessage());
listener.onError(throwable);
finishLatch.countDown();
}
<artifactId>utils</artifactId>
<version>${policy.common.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>policy-endpoints</artifactId>
+ <version>${policy.common.version}</version>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>jakarta.xml.bind</groupId>
+ <artifactId>jakarta.xml.bind-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.ws.rs</groupId>
+ <artifactId>jakarta.ws.rs-api</artifactId>
+ </dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpcore</artifactId>
+ </dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<version>${version.jersey}</version>
+ <scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
+ <scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.common</groupId>
- <artifactId>policy-endpoints</artifactId>
- <version>${policy.common.version}</version>
- <scope>test</scope>
</dependency>
</dependencies>
</project>
<artifactId>gson</artifactId>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
- <artifactId>rest</artifactId>
- <version>${project.version}</version>
- </dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>org.onap.policy.common</groupId>
- <artifactId>policy-endpoints</artifactId>
- <version>${policy.common.version}</version>
- <scope>provided</scope>
- </dependency>
</dependencies>
</project>
<artifactId>so</artifactId>
<dependencies>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>gson</artifactId>
+ <version>${policy.common.version}</version>
+ </dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
- <artifactId>rest</artifactId>
- <version>${project.version}</version>
+ <groupId>jakarta.ws.rs</groupId>
+ <artifactId>jakarta.ws.rs-api</artifactId>
</dependency>
<dependency>
- <groupId>org.onap.policy.common</groupId>
- <artifactId>policy-endpoints</artifactId>
- <version>${policy.common.version}</version>
- <scope>provided</scope>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
============LICENSE_START=======================================================
Copyright (C) 2017 Intel Corp. All rights reserved.
Modifications Copyright (C) 2018-2021 AT&T Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2019, 2023 Nordix Foundation.
+ Modifications Copyright (C) 2019, 2023-2024 Nordix Foundation.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
- <artifactId>rest</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.common</groupId>
- <artifactId>policy-endpoints</artifactId>
- <version>${policy.common.version}</version>
- <scope>provided</scope>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
</dependency>
</dependencies>
</project>
<artifactId>policy-endpoints</artifactId>
<version>${policy.common.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>message-bus</artifactId>
+ <version>${policy.common.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>utils</artifactId>
+ <version>${policy.common.version}</version>
+ </dependency>
<dependency>
<groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
<artifactId>aai</artifactId>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <scope>provided</scope>
+ <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
+ <artifactId>rest</artifactId>
+ <version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.onap.policy.models</groupId>
<version>${policy.common.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.onap.aai.schema-service</groupId>
+ <artifactId>aai-schema</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor.modules</groupId>
+ <artifactId>blueprint-proto</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.protobuf</groupId>
+ <artifactId>protobuf-java-util</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.google.protobuf</groupId>
+ <artifactId>protobuf-java</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-netty</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-stub</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.ws.rs</groupId>
+ <artifactId>jakarta.ws.rs-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty.toolchain</groupId>
+ <artifactId>jetty-jakarta-servlet-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ </dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
package org.onap.policy.simulators;
import org.onap.policy.appclcm.AppcLcmMessageWrapper;
-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.TopicSink;
+import org.onap.policy.common.message.bus.event.TopicSource;
import org.onap.policy.common.utils.coder.StandardCoder;
import org.onap.policy.common.utils.resources.ResourceUtils;
* ONAP
* ================================================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
package org.onap.policy.simulators;
import org.onap.policy.appc.Request;
-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.TopicSink;
+import org.onap.policy.common.message.bus.event.TopicSource;
import org.onap.policy.common.utils.coder.StandardCoderInstantAsMillis;
import org.onap.policy.common.utils.resources.ResourceUtils;
* ONAP
* ================================================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
package org.onap.policy.simulators;
-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.TopicSink;
+import org.onap.policy.common.message.bus.event.TopicSource;
import org.onap.policy.common.utils.coder.StandardCoder;
import org.onap.policy.common.utils.resources.ResourceUtils;
import org.onap.policy.sdnr.PciMessage;
* ONAP
* ================================================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
package org.onap.policy.simulators;
-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.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.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.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.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.TopicSink;
+import org.onap.policy.common.message.bus.event.TopicSource;
import org.onap.policy.common.utils.resources.ResourceUtils;
@ExtendWith(MockitoExtension.class)
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.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.TopicSink;
+import org.onap.policy.common.message.bus.event.TopicSource;
import org.onap.policy.common.utils.resources.ResourceUtils;
@ExtendWith(MockitoExtension.class)
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.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.TopicSink;
+import org.onap.policy.common.message.bus.event.TopicSource;
import org.onap.policy.common.utils.resources.ResourceUtils;
@ExtendWith(MockitoExtension.class)
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.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.TopicSink;
+import org.onap.policy.common.message.bus.event.TopicSource;
import org.onap.policy.common.utils.coder.StandardCoder;
@ExtendWith(MockitoExtension.class)
<!--
============LICENSE_START=======================================================
- Copyright (C) 2019 Nordix Foundation.
+ Copyright (C) 2019, 2024 Nordix Foundation.
Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
<properties>
<jacoco.dataFile>${project.basedir}/../../target/code-coverage/jacoco-ut.exec</jacoco.dataFile>
+ <grpc.version>1.29.0</grpc.version>
+ <aai.version>1.12.5</aai.version>
+ <protobuf-java.version>3.10.0</protobuf-java.version>
</properties>
<modules>
<module>model-impl</module>
<module>model-actors</module>
</modules>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.onap.aai.schema-service</groupId>
+ <artifactId>aai-schema</artifactId>
+ <version>${aai.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>com.google.code.javaparser</groupId>
+ <artifactId>javaparser</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.googlecode.json-simple</groupId>
+ <artifactId>json-simple</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-core</artifactId>
+ <version>${grpc.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-stub</artifactId>
+ <version>${grpc.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-api</artifactId>
+ <version>${grpc.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-netty</artifactId>
+ <version>${grpc.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.grpc</groupId>
+ <artifactId>grpc-testing</artifactId>
+ <version>${grpc.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.protobuf</groupId>
+ <artifactId>protobuf-java</artifactId>
+ <version>${protobuf-java.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.google.protobuf</groupId>
+ <artifactId>protobuf-java-util</artifactId>
+ <version>${protobuf-java.version}</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
</project>
<groupId>org.onap.policy.models</groupId>
<artifactId>policy-models-pdp</artifactId>
<version>${project.version}</version>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>org.onap.policy.models</groupId>
<artifactId>policy-models-tosca</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>common-parameters</artifactId>
+ <version>${policy.common.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>utils</artifactId>
+ <version>${policy.common.version}</version>
+ </dependency>
<dependency>
<groupId>org.onap.policy.common</groupId>
<artifactId>utils-test</artifactId>
<version>${policy.common.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.persistence</groupId>
+ <artifactId>jakarta.persistence-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.validation</groupId>
+ <artifactId>jakarta.validation-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ </dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<artifactId>policy-models-base</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models-dao</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>org.onap.policy.models</groupId>
<artifactId>policy-models-tosca</artifactId>
<artifactId>common-parameters</artifactId>
<version>${policy.common.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>gson</artifactId>
+ <version>${policy.common.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>utils</artifactId>
+ <version>${policy.common.version}</version>
+ </dependency>
<dependency>
<groupId>org.onap.policy.common</groupId>
<artifactId>utils-test</artifactId>
<version>${policy.common.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>jakarta.persistence</groupId>
+ <artifactId>jakarta.persistence-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.ws.rs</groupId>
+ <artifactId>jakarta.ws.rs-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate.orm</groupId>
+ <artifactId>hibernate-core</artifactId>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<groupId>org.onap.policy.common</groupId>
<artifactId>utils</artifactId>
<version>${policy.common.version}</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.onap.policy.models</groupId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>jakarta.persistence</groupId>
+ <artifactId>jakarta.persistence-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.ws.rs</groupId>
+ <artifactId>jakarta.ws.rs-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate.orm</groupId>
+ <artifactId>hibernate-core</artifactId>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<artifactId>policy-endpoints</artifactId>
<version>${policy.common.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>message-bus</artifactId>
+ <version>${policy.common.version}</version>
+ </dependency>
<dependency>
<groupId>org.onap.policy.common</groupId>
<artifactId>utils-test</artifactId>
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019, 2024 Nordix Foundation.
* Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
import java.util.Random;
import lombok.Getter;
import lombok.Setter;
-import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager;
-import org.onap.policy.common.endpoints.event.comm.TopicSink;
-import org.onap.policy.common.endpoints.event.comm.TopicSource;
import org.onap.policy.common.endpoints.listeners.MessageTypeDispatcher;
+import org.onap.policy.common.message.bus.event.TopicEndpointManager;
+import org.onap.policy.common.message.bus.event.TopicSink;
+import org.onap.policy.common.message.bus.event.TopicSource;
import org.onap.policy.common.utils.services.Registry;
import org.onap.policy.common.utils.services.ServiceManager;
import org.onap.policy.common.utils.services.ServiceManagerException;
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019, 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.
package org.onap.policy.models.sim.pdp.comm;
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
import org.onap.policy.common.endpoints.listeners.ScoListener;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
import org.onap.policy.common.utils.coder.StandardCoderObject;
import org.onap.policy.models.pdp.concepts.PdpStateChange;
import org.onap.policy.models.sim.pdp.handler.PdpStateChangeMessageHandler;
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019, 2023 Nordix Foundation.
+ * Copyright (C) 2019, 2023-2024 Nordix Foundation.
* Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
import java.util.Timer;
import java.util.TimerTask;
import lombok.Getter;
-import org.onap.policy.common.endpoints.event.comm.TopicSink;
-import org.onap.policy.common.endpoints.event.comm.client.TopicSinkClient;
+import org.onap.policy.common.message.bus.event.TopicSink;
+import org.onap.policy.common.message.bus.event.client.TopicSinkClient;
import org.onap.policy.models.pdp.concepts.PdpStatus;
import org.onap.policy.models.sim.pdp.handler.PdpMessageHandler;
import org.slf4j.Logger;
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019, 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.
package org.onap.policy.models.sim.pdp.comm;
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
import org.onap.policy.common.endpoints.listeners.ScoListener;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
import org.onap.policy.common.utils.coder.StandardCoderObject;
import org.onap.policy.models.pdp.concepts.PdpUpdate;
import org.onap.policy.models.sim.pdp.handler.PdpUpdateMessageHandler;
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019-2021 Nordix Foundation.
+ * Copyright (C) 2019-2021, 2024 Nordix Foundation.
* Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
-import org.onap.policy.common.endpoints.event.comm.TopicSink;
+import org.onap.policy.common.message.bus.event.TopicSink;
import org.onap.policy.common.utils.services.Registry;
import org.onap.policy.models.pdp.concepts.PdpResponseDetails;
import org.onap.policy.models.pdp.concepts.PdpStatus;
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019, 2024 Nordix Foundation.
* Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.sim.pdp.parameters;
import lombok.Getter;
-import org.onap.policy.common.endpoints.parameters.TopicParameterGroup;
import org.onap.policy.common.parameters.ParameterGroupImpl;
import org.onap.policy.common.parameters.annotations.NotBlank;
import org.onap.policy.common.parameters.annotations.NotNull;
import org.onap.policy.common.parameters.annotations.Valid;
+import org.onap.policy.common.parameters.topic.TopicParameterGroup;
/**
* Class to hold all parameters needed for pdp simulator component.
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.io.IOException;
-import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
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.message.bus.event.Topic.CommInfrastructure;
import org.onap.policy.common.utils.services.Registry;
import org.onap.policy.models.pdp.concepts.PdpStateChange;
import org.onap.policy.models.pdp.concepts.PdpStatus;
String properties;
try {
- properties = new String(Files.readAllBytes(Paths.get("src\\test\\resources\\dummyProperties.json")),
- StandardCharsets.UTF_8);
+ properties = Files.readString(Paths.get("src\\test\\resources\\dummyProperties.json"));
propertiesMap.put("content", properties);
} catch (final IOException e) {
propertiesMap.put("content", "");
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.io.IOException;
-import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
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.message.bus.event.Topic.CommInfrastructure;
import org.onap.policy.common.utils.services.Registry;
import org.onap.policy.models.pdp.concepts.PdpStatus;
import org.onap.policy.models.pdp.concepts.PdpUpdate;
pdpUpdateMsg.setPdpGroup("pdpGroup");
pdpUpdateMsg.setPdpSubgroup("pdpSubgroup");
pdpUpdateMsg.setName(pdpStatus.getName());
- pdpUpdateMsg.setPdpHeartbeatIntervalMs(Long.valueOf(3000));
+ pdpUpdateMsg.setPdpHeartbeatIntervalMs(3000L);
final ToscaPolicy toscaPolicy = new ToscaPolicy();
toscaPolicy.setType("apexpolicytype");
toscaPolicy.setVersion("1.0");
final Map<String, Object> propertiesMap = new LinkedHashMap<>();
String properties;
try {
- properties = new String(Files.readAllBytes(Paths.get("src\\test\\resources\\dummyProperties.json")),
- StandardCharsets.UTF_8);
+ properties = Files.readString(Paths.get("src\\test\\resources\\dummyProperties.json"));
propertiesMap.put("content", properties);
} catch (final IOException e) {
propertiesMap.put("content", "");
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
-import org.onap.policy.common.endpoints.parameters.TopicParameters;
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;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.Map;
import org.junit.jupiter.api.Test;
-import org.onap.policy.common.endpoints.parameters.TopicParameterGroup;
import org.onap.policy.common.parameters.ValidationResult;
+import org.onap.policy.common.parameters.topic.TopicParameterGroup;
/**
* Class to perform unit test of {@link PdpSimulatorParameterGroup}.
.toObject(commonTestData.getPdpSimulatorParameterGroupMap(null), PdpSimulatorParameterGroup.class);
final ValidationResult validationResult = pdpSimulatorParameters.validate();
assertFalse(validationResult.isValid());
- assertEquals(null, pdpSimulatorParameters.getName());
+ assertNull(pdpSimulatorParameters.getName());
assertTrue(validationResult.getResult().contains("is null"));
}
* ================================================================================
* Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2021 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.
package org.onap.policy.models.simulators;
import lombok.Getter;
-import org.onap.policy.common.endpoints.parameters.RestServerParameters;
import org.onap.policy.common.parameters.annotations.ClassName;
import org.onap.policy.common.parameters.annotations.NotNull;
+import org.onap.policy.common.parameters.rest.RestServerParameters;
@Getter
public class ClassRestServerParameters extends RestServerParameters {
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertInstanceOf;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
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;
import org.onap.policy.common.endpoints.http.server.HttpServletServer;
import org.onap.policy.common.endpoints.http.server.internal.JettyJerseyServer;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
import org.onap.policy.common.utils.coder.Coder;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.network.NetworkUtil;
* Saves system properties.
*/
@BeforeAll
- public static void setUpBeforeClass() throws IOException, InterruptedException {
+ public static void setUpBeforeClass() throws IOException {
savedValues = new HashMap<>();
for (String prop : List.of(JettyJerseyServer.SYSTEM_KEYSTORE_PASSWORD_PROPERTY_NAME,
RuntimeException ex = queue.poll(5, TimeUnit.SECONDS);
assertNotNull(ex);
- assertTrue(ex.getCause() instanceof IllegalStateException);
+ assertInstanceOf(IllegalStateException.class, ex.getCause());
assertThat(ex.getCause()).hasMessageStartingWith("interrupted while building");
}
-
-
}
<artifactId>policy-models-dao</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models-errors</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>org.onap.policy.models</groupId>
<artifactId>policy-models-examples</artifactId>
<version>${project.version}</version>
- <scope>provided</scope>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>org.onap.policy.common</groupId>
<version>${policy.common.version}</version>
</dependency>
<dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <scope>provided</scope>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>utils</artifactId>
+ <version>${policy.common.version}</version>
</dependency>
<dependency>
<groupId>org.onap.policy.common</groupId>
<version>${policy.common.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.persistence</groupId>
+ <artifactId>jakarta.persistence-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.ws.rs</groupId>
+ <artifactId>jakarta.ws.rs-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-collections4</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.yaml</groupId>
+ <artifactId>snakeyaml</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate.orm</groupId>
+ <artifactId>hibernate-core</artifactId>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>