<artifactId>drools-model-compiler</artifactId>
<version>${version.drools}</version>
</dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<profiles>
================================================================================
Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
Modifications Copyright (C) 2020 Bell Canada.
- Modifications Copyright (C) 2023 Nordix Foundation.
+ Modifications Copyright (C) 2023-2024 Nordix Foundation.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
<version>${version.policy.drools-pdp}</version>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.yaml</groupId>
+ <artifactId>snakeyaml</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
</dependencies>
</project>
<dependencies>
<dependency>
- <groupId>org.hibernate.orm</groupId>
- <artifactId>hibernate-core</artifactId>
+ <groupId>org.onap.policy.drools-pdp</groupId>
+ <artifactId>policy-core</artifactId>
+ <version>${version.policy.drools-pdp}</version>
</dependency>
<dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <scope>provided</scope>
+ <groupId>org.onap.policy.drools-pdp</groupId>
+ <artifactId>policy-utils</artifactId>
+ <version>${version.policy.drools-pdp}</version>
</dependency>
<dependency>
- <!-- less than 1.9.4 has security vulnerabilities -->
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils</artifactId>
+ <groupId>org.onap.policy.drools-pdp</groupId>
+ <artifactId>policy-management</artifactId>
+ <version>${version.policy.drools-pdp}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.drools-pdp</groupId>
+ <artifactId>policy-domains</artifactId>
+ <version>${version.policy.drools-pdp}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models-decisions</artifactId>
+ <version>${policy.models.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models-examples</artifactId>
+ <version>${policy.models.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.policy.models</groupId>
+ <artifactId>policy-models-tosca</artifactId>
+ <version>${policy.models.version}</version>
</dependency>
<dependency>
<groupId>org.onap.policy.models.policy-models-interactions.model-actors</groupId>
<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>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
<artifactId>aai</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.onap.policy.models</groupId>
- <artifactId>policy-models-decisions</artifactId>
+ <groupId>org.onap.policy.models.policy-models-interactions</groupId>
+ <artifactId>simulators</artifactId>
<version>${policy.models.version}</version>
+ <scope>test</scope>
</dependency>
<dependency>
- <groupId>org.apache.httpcomponents.client5</groupId>
- <artifactId>httpclient5</artifactId>
- <scope>provided</scope>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>common-parameters</artifactId>
+ <version>${version.policy.common}</version>
</dependency>
<dependency>
<groupId>org.onap.policy.common</groupId>
<artifactId>policy-endpoints</artifactId>
<version>${version.policy.common}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.onap.policy.drools-pdp</groupId>
- <artifactId>policy-management</artifactId>
- <version>${version.policy.drools-pdp}</version>
- <scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.onap.policy.drools-pdp</groupId>
- <artifactId>policy-domains</artifactId>
- <version>${version.policy.drools-pdp}</version>
- <scope>provided</scope>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>utils</artifactId>
+ <version>${version.policy.common}</version>
</dependency>
<dependency>
<groupId>org.onap.policy.common</groupId>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.onap.policy.models.policy-models-interactions</groupId>
- <artifactId>simulators</artifactId>
- <version>${policy.models.version}</version>
- <scope>test</scope>
+ <groupId>org.hibernate.orm</groupId>
+ <artifactId>hibernate-core</artifactId>
+ <scope>runtime</scope>
</dependency>
<dependency>
- <groupId>org.onap.policy.models</groupId>
- <artifactId>policy-models-examples</artifactId>
- <version>${policy.models.version}</version>
- <scope>test</scope>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.awaitility</groupId>
+ <artifactId>awaitility</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.openpojo</groupId>
+ <artifactId>openpojo</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jakarta.persistence</groupId>
+ <artifactId>jakarta.persistence-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.kie</groupId>
+ <artifactId>kie-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
</dependencies>
</project>
ONAP
================================================================================
Copyright (C) 2018-2021 AT&T Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2019,2023 Nordix Foundation.
+ Modifications Copyright (C) 2019, 2023-2024 Nordix Foundation.
Modifications Copyright (C) 2020 Bell Canada.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
<version>${policy.models.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.awaitility</groupId>
+ <artifactId>awaitility</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
ONAP
================================================================================
Copyright (C) 2018-2021 AT&T Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2019,2023 Nordix Foundation.
+ Modifications Copyright (C) 2019, 2023-2024 Nordix Foundation.
Modifications Copyright (C) 2020 Bell Canada.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
<artifactId>guava</artifactId>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.awaitility</groupId>
+ <artifactId>awaitility</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
* ONAP
* ================================================================================
* Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
package org.onap.policy.drools.apps.controlloop.feature.trans;
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
import org.onap.policy.controlloop.VirtualControlLoopNotification;
import org.onap.policy.drools.features.PolicyControllerFeatureApi;
import org.onap.policy.drools.system.PolicyController;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
import org.onap.policy.common.utils.resources.ResourceUtils;
import org.onap.policy.controlloop.ControlLoopNotificationType;
import org.onap.policy.controlloop.VirtualControlLoopNotification;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
-import org.onap.policy.common.endpoints.event.comm.Topic;
-import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
import org.onap.policy.common.endpoints.http.client.HttpClient;
import org.onap.policy.common.endpoints.http.client.HttpClientFactoryInstance;
import org.onap.policy.common.endpoints.http.server.HttpServletServerFactoryInstance;
+import org.onap.policy.common.message.bus.event.Topic;
+import org.onap.policy.common.parameters.topic.BusTopicParams;
import org.onap.policy.common.utils.network.NetworkUtil;
import org.onap.policy.common.utils.resources.ResourceUtils;
import org.onap.policy.controlloop.VirtualControlLoopNotification;
equals(get("cacheSize", Response.Status.OK.getStatusCode()), Integer.class, 3);
equals(get("timeout", Response.Status.OK.getStatusCode()), Integer.class, 2);
- put("cacheSize/10", "", Response.Status.OK.getStatusCode());
- put("timeout/20", "", Response.Status.OK.getStatusCode());
+ put("cacheSize/10", Response.Status.OK.getStatusCode());
+ put("timeout/20", Response.Status.OK.getStatusCode());
equals(get("cacheSize", Response.Status.OK.getStatusCode()), Integer.class, 10);
equals(get("timeout", Response.Status.OK.getStatusCode()), Integer.class, 20);
- put("cacheSize/3", "", Response.Status.OK.getStatusCode());
- put("timeout/2", "", Response.Status.OK.getStatusCode());
+ put("cacheSize/3", Response.Status.OK.getStatusCode());
+ put("timeout/2", Response.Status.OK.getStatusCode());
equals(get("cacheSize", Response.Status.OK.getStatusCode()), Integer.class, 3);
equals(get("timeout", Response.Status.OK.getStatusCode()), Integer.class, 2);
assertFalse(HttpClient.getBody(get("/inprogress", Response.Status.OK.getStatusCode()),
List.class).isEmpty());
- notNull(get("/inprogress/664be3d2-6c12-4f4b-a3e7-c349acced200", Response.Status.OK.getStatusCode()),
- String.class);
+ notNull(get("/inprogress/664be3d2-6c12-4f4b-a3e7-c349acced200", Response.Status.OK.getStatusCode())
+ );
}
private Response get(String contextPath, int statusCode) {
var response = client.get(contextPath);
- return checkResponse(statusCode, response);
+ checkResponse(statusCode, response);
+ return response;
}
- private Response put(String contextPath, String body, int statusCode) {
- var response = client.put(contextPath, Entity.json(body), Collections.emptyMap());
- return checkResponse(statusCode, response);
+ private void put(String contextPath, int statusCode) {
+ var response = client.put(contextPath, Entity.json(""), Collections.emptyMap());
+ checkResponse(statusCode, response);
+ response.close();
}
private <T, Y> void equals(Response response, Class<T> clazz, Y expected) {
assertEquals(expected, HttpClient.getBody(response, clazz));
}
- private <T> void notNull(Response response, Class<T> clazz) {
- assertNotNull(HttpClient.getBody(response, clazz));
+ private <T> void notNull(Response response) {
+ assertNotNull(HttpClient.getBody(response, (Class<T>) String.class));
}
- private Response checkResponse(int statusCode, Response response) {
+ private void checkResponse(int statusCode, Response response) {
assertEquals(statusCode, response.getStatus());
- return response;
}
}
\ No newline at end of file
================================================================================
Copyright (C) 2018-2020 AT&T Intellectual Property. All rights reserved.
Modifications Copyright (C) 2020 Bell Canada.
- Modifications Copyright (C) 2023 Nordix Foundation.
+ Modifications Copyright (C) 2023-2024 Nordix Foundation.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
<version>${version.policy.drools-pdp}</version>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
</dependencies>
</project>
ONAP
================================================================================
Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
- Modifications Copyright (C) 2019, 2023 Nordix Foundation.
+ Modifications Copyright (C) 2019, 2023-2024 Nordix Foundation.
Modifications Copyright (C) 2020 Bell Canada.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
================================================================================
Copyright (C) 2017, 2019-2020 AT&T Intellectual Property. All rights reserved.
Modifications Copyright (C) 2020 Bell Canada.
- Modifications Copyright (C) 2023 Nordix Foundation.
+ Modifications Copyright (C) 2023-2024 Nordix Foundation.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
<module>feature-controlloop-usecases</module>
</modules>
+ <dependencies>
+ <dependency>
+ <groupId>org.kie</groupId>
+ <artifactId>kie-ci</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.swagger.core.v3</groupId>
+ <artifactId>swagger-annotations</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-api</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.assertj</groupId>
+ <artifactId>assertj-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
</project>
<version>${policy.models.version}</version>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.onap.policy.common</groupId>
+ <artifactId>message-bus</artifactId>
+ <version>${version.policy.common}</version>
+ </dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
* 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.TimeoutException;
import java.util.function.Function;
import java.util.function.Predicate;
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
-import org.onap.policy.common.endpoints.event.comm.TopicEndpoint;
-import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager;
-import org.onap.policy.common.endpoints.event.comm.TopicListener;
-import org.onap.policy.common.endpoints.event.comm.TopicSink;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.event.TopicEndpoint;
+import org.onap.policy.common.message.bus.event.TopicEndpointManager;
+import org.onap.policy.common.message.bus.event.TopicListener;
+import org.onap.policy.common.message.bus.event.TopicSink;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
* 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.LinkedList;
import java.util.List;
import java.util.function.Function;
-import org.onap.policy.common.endpoints.event.comm.TopicEndpoint;
-import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager;
+import org.onap.policy.common.message.bus.event.TopicEndpoint;
+import org.onap.policy.common.message.bus.event.TopicEndpointManager;
import org.onap.policy.common.utils.coder.Coder;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.resources.ResourceUtils;
* 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 org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
-import org.onap.policy.common.endpoints.event.comm.TopicEndpoint;
-import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager;
-import org.onap.policy.common.endpoints.event.comm.bus.NoopTopicSink;
-import org.onap.policy.common.endpoints.parameters.TopicParameters;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.event.TopicEndpoint;
+import org.onap.policy.common.message.bus.event.TopicEndpointManager;
+import org.onap.policy.common.message.bus.event.noop.NoopTopicSink;
+import org.onap.policy.common.parameters.topic.TopicParameters;
class ListenerTest {
private static final String EXPECTED_EXCEPTION = "expected exception";
*/
@Test
void testAwaitLongTimeUnitPredicateInterrupted() throws InterruptedException {
- listener = new Listener<String>(MY_TOPIC, msg -> msg) {
+ listener = new Listener<>(MY_TOPIC, msg -> msg) {
@Override
protected String pollMessage(long remainingMs) throws InterruptedException {
throw new InterruptedException(EXPECTED_EXCEPTION);
AtomicReference<TopicException> exref = new AtomicReference<>();
var interrupted = new CountDownLatch(1);
- var thread = new Thread() {
- @Override
- public void run() {
- try {
- listener.await();
- } catch (TopicException e) {
- exref.set(e);
- }
-
- if (Thread.currentThread().isInterrupted()) {
- interrupted.countDown();
- }
+ var thread = new Thread(() -> {
+ try {
+ listener.await();
+ } catch (TopicException e) {
+ exref.set(e);
}
- };
+
+ if (Thread.currentThread().isInterrupted()) {
+ interrupted.countDown();
+ }
+ });
thread.start();
assertTrue(interrupted.await(5, TimeUnit.SECONDS));
* 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 org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
-import org.onap.policy.common.endpoints.event.comm.TopicEndpoint;
-import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager;
-import org.onap.policy.common.endpoints.event.comm.bus.NoopTopicSink;
-import org.onap.policy.common.endpoints.event.comm.bus.NoopTopicSource;
-import org.onap.policy.common.endpoints.parameters.TopicParameters;
+import org.onap.policy.common.message.bus.event.Topic.CommInfrastructure;
+import org.onap.policy.common.message.bus.event.TopicEndpoint;
+import org.onap.policy.common.message.bus.event.TopicEndpointManager;
+import org.onap.policy.common.message.bus.event.noop.NoopTopicSink;
+import org.onap.policy.common.message.bus.event.noop.NoopTopicSource;
+import org.onap.policy.common.parameters.topic.TopicParameters;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
import org.onap.policy.drools.controller.DroolsController;
</plugins>
</reporting>
- <dependencies>
- <dependency>
- <groupId>org.kie</groupId>
- <artifactId>kie-ci</artifactId>
- </dependency>
-
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter-api</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter-engine</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-junit-jupiter</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-test</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.assertj</groupId>
- <artifactId>assertj-core</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.awaitility</groupId>
- <artifactId>awaitility</artifactId>
- <scope>test</scope>
- </dependency>
-
- <!-- Swagger v3 annotations -->
- <dependency>
- <groupId>io.swagger.core.v3</groupId>
- <artifactId>swagger-annotations</artifactId>
- </dependency>
- </dependencies>
</project>