aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/common/feature-controlloop-trans
diff options
context:
space:
mode:
authoradheli.tavares <adheli.tavares@est.tech>2024-01-31 10:39:45 +0000
committerAdheli Tavares <adheli.tavares@est.tech>2024-02-09 14:28:59 +0000
commiteeb8a6a39d2bdd20bc54c11ac69700739d8faac1 (patch)
treeb22a3a34482af847905062fb1ebeab43cab39162 /controlloop/common/feature-controlloop-trans
parentb0455b141643f18d5025e23ac7859da43afe7f19 (diff)
Remove deprecated DMAAP dependency
Issue-ID: POLICY-4402 Change-Id: Id3bf1f5833b7d6086345b3747505e2f57036d4ea Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
Diffstat (limited to 'controlloop/common/feature-controlloop-trans')
-rw-r--r--controlloop/common/feature-controlloop-trans/src/test/java/org/onap/policy/drools/apps/controlloop/feature/trans/ControlLoopMetricsFeatureTest.java30
-rw-r--r--controlloop/common/feature-controlloop-trans/src/test/java/org/onap/policy/drools/server/restful/RestTransactionTrackerTest.java4
2 files changed, 17 insertions, 17 deletions
diff --git a/controlloop/common/feature-controlloop-trans/src/test/java/org/onap/policy/drools/apps/controlloop/feature/trans/ControlLoopMetricsFeatureTest.java b/controlloop/common/feature-controlloop-trans/src/test/java/org/onap/policy/drools/apps/controlloop/feature/trans/ControlLoopMetricsFeatureTest.java
index 77ce83b83..164cdb733 100644
--- a/controlloop/common/feature-controlloop-trans/src/test/java/org/onap/policy/drools/apps/controlloop/feature/trans/ControlLoopMetricsFeatureTest.java
+++ b/controlloop/common/feature-controlloop-trans/src/test/java/org/onap/policy/drools/apps/controlloop/feature/trans/ControlLoopMetricsFeatureTest.java
@@ -3,7 +3,7 @@
* ONAP
* ================================================================================
* Copyright (C) 2018-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.
@@ -96,13 +96,13 @@ class ControlLoopMetricsFeatureTest {
void testInvalidNotifications() {
var feature = new ControlLoopMetricsFeature();
var notification = new VirtualControlLoopNotification();
- feature.beforeDeliver(testController, CommInfrastructure.DMAAP, POLICY_CL_MGT, notification);
+ feature.beforeDeliver(testController, CommInfrastructure.NOOP, POLICY_CL_MGT, notification);
this.testCacheDefaults();
var requestId = UUID.randomUUID();
notification.setRequestId(requestId);
- feature.beforeDeliver(testController, CommInfrastructure.DMAAP, POLICY_CL_MGT, notification);
+ feature.beforeDeliver(testController, CommInfrastructure.NOOP, POLICY_CL_MGT, notification);
assertNull(ControlLoopMetricsManager.getManager().getTransaction(requestId));
this.testCacheDefaults();
}
@@ -115,7 +115,7 @@ class ControlLoopMetricsFeatureTest {
notification.setRequestId(requestId);
notification.setNotification(ControlLoopNotificationType.ACTIVE);
- feature.beforeDeliver(testController, CommInfrastructure.DMAAP, POLICY_CL_MGT, notification);
+ feature.beforeDeliver(testController, CommInfrastructure.NOOP, POLICY_CL_MGT, notification);
assertNotNull(ControlLoopMetricsManager.getManager().getTransaction(requestId));
assertTrue(ControlLoopMetricsManager.getManager().getTransaction(requestId).getFrom()
.contains(testController.getName()));
@@ -132,7 +132,7 @@ class ControlLoopMetricsFeatureTest {
@Test
void testReset() {
var notification = this.generateNotification();
- new ControlLoopMetricsFeature().beforeDeliver(testController, CommInfrastructure.DMAAP, POLICY_CL_MGT,
+ new ControlLoopMetricsFeature().beforeDeliver(testController, CommInfrastructure.NOOP, POLICY_CL_MGT,
notification);
assertNotNull(ControlLoopMetricsManager.getManager().getTransaction(notification.getRequestId()));
@@ -160,7 +160,7 @@ class ControlLoopMetricsFeatureTest {
var feature = new ControlLoopMetricsFeature();
for (int i = 0; i < ControlLoopMetricsManager.getManager().getCacheSize(); i++) {
var notification = generateNotification();
- feature.beforeDeliver(testController, CommInfrastructure.DMAAP, POLICY_CL_MGT, notification);
+ feature.beforeDeliver(testController, CommInfrastructure.NOOP, POLICY_CL_MGT, notification);
assertNotNull(ControlLoopMetricsManager.getManager().getTransaction(notification.getRequestId()));
}
@@ -168,7 +168,7 @@ class ControlLoopMetricsFeatureTest {
ControlLoopMetricsManager.getManager().getCacheOccupancy());
var overflowNotification = generateNotification();
- feature.beforeDeliver(testController, CommInfrastructure.DMAAP, POLICY_CL_MGT, overflowNotification);
+ feature.beforeDeliver(testController, CommInfrastructure.NOOP, POLICY_CL_MGT, overflowNotification);
assertEquals(ControlLoopMetricsManager.getManager().getCacheOccupancy(),
ControlLoopMetricsManager.getManager().getCacheOccupancy());
assertNotNull(ControlLoopMetricsManager.getManager().getTransaction(overflowNotification.getRequestId()));
@@ -215,39 +215,39 @@ class ControlLoopMetricsFeatureTest {
var activeNotification = ResourceUtils.getResourceAsString("policy-cl-mgt-active.json");
var active =
Serialization.gsonPretty.fromJson(activeNotification, VirtualControlLoopNotification.class);
- feature.beforeDeliver(testController, CommInfrastructure.DMAAP, POLICY_CL_MGT, active);
+ feature.beforeDeliver(testController, CommInfrastructure.NOOP, POLICY_CL_MGT, active);
assertEquals(1, ControlLoopMetricsManager.getManager().getTransactionIds().size());
var opStartNotification = ResourceUtils.getResourceAsString("policy-cl-mgt-operation.json");
var opStart =
Serialization.gsonPretty.fromJson(opStartNotification, VirtualControlLoopNotification.class);
- feature.beforeDeliver(testController, CommInfrastructure.DMAAP, POLICY_CL_MGT, opStart);
+ feature.beforeDeliver(testController, CommInfrastructure.NOOP, POLICY_CL_MGT, opStart);
assertEquals(1, ControlLoopMetricsManager.getManager().getTransactionIds().size());
var permitNotification = ResourceUtils.getResourceAsString("policy-cl-mgt-permit.json");
var permit =
Serialization.gsonPretty.fromJson(permitNotification, VirtualControlLoopNotification.class);
- feature.beforeDeliver(testController, CommInfrastructure.DMAAP, POLICY_CL_MGT, permit);
+ feature.beforeDeliver(testController, CommInfrastructure.NOOP, POLICY_CL_MGT, permit);
assertEquals(1, ControlLoopMetricsManager.getManager().getTransactionIds().size());
var restartNotification = ResourceUtils.getResourceAsString("policy-cl-mgt-restart.json");
var restart =
Serialization.gsonPretty.fromJson(restartNotification, VirtualControlLoopNotification.class);
- feature.beforeDeliver(testController, CommInfrastructure.DMAAP, POLICY_CL_MGT, restart);
+ feature.beforeDeliver(testController, CommInfrastructure.NOOP, POLICY_CL_MGT, restart);
assertEquals(1, ControlLoopMetricsManager.getManager().getTransactionIds().size());
var restartSuccessNotification =
ResourceUtils.getResourceAsString("policy-cl-mgt-restart-success.json");
var restartSuccess =
Serialization.gsonPretty.fromJson(restartSuccessNotification, VirtualControlLoopNotification.class);
- feature.beforeDeliver(testController, CommInfrastructure.DMAAP, POLICY_CL_MGT, restartSuccess);
+ feature.beforeDeliver(testController, CommInfrastructure.NOOP, POLICY_CL_MGT, restartSuccess);
assertEquals(1, ControlLoopMetricsManager.getManager().getTransactionIds().size());
var finalSuccessNotification =
ResourceUtils.getResourceAsString("policy-cl-mgt-final-success.json");
var finalSuccess =
Serialization.gsonPretty.fromJson(finalSuccessNotification, VirtualControlLoopNotification.class);
- feature.beforeDeliver(testController, CommInfrastructure.DMAAP, POLICY_CL_MGT, finalSuccess);
+ feature.beforeDeliver(testController, CommInfrastructure.NOOP, POLICY_CL_MGT, finalSuccess);
assertEquals(0, ControlLoopMetricsManager.getManager().getTransactionIds().size());
assertEquals(1,
PolicyEngineConstants.getManager().getStats().getGroupStat().getPolicyExecutedSuccessCount());
@@ -273,14 +273,14 @@ class ControlLoopMetricsFeatureTest {
var finalSuccess =
Serialization.gsonPretty.fromJson(finalSuccessNotification, VirtualControlLoopNotification.class);
finalSuccess.setRequestId(UUID.randomUUID());
- feature.beforeDeliver(testController, CommInfrastructure.DMAAP, POLICY_CL_MGT, finalSuccess);
+ feature.beforeDeliver(testController, CommInfrastructure.NOOP, POLICY_CL_MGT, finalSuccess);
assertEquals(0, ControlLoopMetricsManager.getManager().getTransactionIds().size());
var opStartNotification =
ResourceUtils.getResourceAsString("policy-cl-mgt-operation.json");
var opStart =
Serialization.gsonPretty.fromJson(opStartNotification, VirtualControlLoopNotification.class);
- feature.beforeDeliver(testController, CommInfrastructure.DMAAP, POLICY_CL_MGT, opStart);
+ feature.beforeDeliver(testController, CommInfrastructure.NOOP, POLICY_CL_MGT, opStart);
assertEquals(1, ControlLoopMetricsManager.getManager().getTransactionIds().size());
Thread.sleep((ControlLoopMetricsManager.getManager().getTransactionTimeout() + 1) * 1000L); // NOSONAR
diff --git a/controlloop/common/feature-controlloop-trans/src/test/java/org/onap/policy/drools/server/restful/RestTransactionTrackerTest.java b/controlloop/common/feature-controlloop-trans/src/test/java/org/onap/policy/drools/server/restful/RestTransactionTrackerTest.java
index 39adb8120..1ada2714c 100644
--- a/controlloop/common/feature-controlloop-trans/src/test/java/org/onap/policy/drools/server/restful/RestTransactionTrackerTest.java
+++ b/controlloop/common/feature-controlloop-trans/src/test/java/org/onap/policy/drools/server/restful/RestTransactionTrackerTest.java
@@ -3,7 +3,7 @@
* ONAP
* ================================================================================
* Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
- * Modifications Copyright (C) 2023 Nordix Foundation.
+ * Modifications Copyright (C) 2023-2024 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -123,7 +123,7 @@ class RestTransactionTrackerTest {
var activeNotification = ResourceUtils.getResourceAsString("policy-cl-mgt-active.json");
var active =
Serialization.gsonPretty.fromJson(activeNotification, VirtualControlLoopNotification.class);
- feature.beforeDeliver(testController, Topic.CommInfrastructure.DMAAP, "POLICY-CL-MGT", active);
+ feature.beforeDeliver(testController, Topic.CommInfrastructure.NOOP, "POLICY-CL-MGT", active);
assertEquals(1, ControlLoopMetricsManager.getManager().getTransactionIds().size());
assertFalse(HttpClient.getBody(get("/inprogress", Response.Status.OK.getStatusCode()),