diff options
Diffstat (limited to 'controlloop/common/rules-test/src/main/java/org/onap')
3 files changed, 17 insertions, 12 deletions
diff --git a/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/BaseTest.java b/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/BaseTest.java index 321938240..15e03e634 100644 --- a/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/BaseTest.java +++ b/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/BaseTest.java @@ -37,7 +37,7 @@ import org.apache.commons.collections.MapUtils; import org.awaitility.Awaitility; import org.junit.jupiter.api.Test; import org.onap.policy.appc.Request; -import org.onap.policy.appclcm.AppcLcmDmaapWrapper; +import org.onap.policy.appclcm.AppcLcmMessageWrapper; import org.onap.policy.common.utils.coder.Coder; import org.onap.policy.common.utils.coder.CoderException; import org.onap.policy.common.utils.coder.StandardCoder; @@ -161,7 +161,7 @@ public abstract class BaseTest { // used to wait for messages on SINK topics protected Listener<VirtualControlLoopNotification> policyClMgt; protected Listener<Request> appcClSink; - protected Listener<AppcLcmDmaapWrapper> appcLcmRead; + protected Listener<AppcLcmMessageWrapper> appcLcmRead; protected Listener<PciMessage> sdnrClSink; /* @@ -212,7 +212,7 @@ public abstract class BaseTest { //TODO This test needs to be enabled in java-17 branch public void testService123Compliant() { policyClMgt = createNoficationTopicListener(); - appcLcmRead = topics.createListener(APPC_LCM_READ_TOPIC, AppcLcmDmaapWrapper.class, APPC_LCM_CODER); + appcLcmRead = topics.createListener(APPC_LCM_READ_TOPIC, AppcLcmMessageWrapper.class, APPC_LCM_CODER); policy = checkPolicy(SERVICE123_TOSCA_COMPLIANT_POLICY); // inject an ONSET event over the DCAE topic @@ -223,13 +223,13 @@ public abstract class BaseTest { // restart request should be sent and fail four times (i.e., because retry=3) for (var count = 0; count < 4; ++count) { - AppcLcmDmaapWrapper appcreq = appcLcmRead.await(req -> APPC_RESTART_OP.equals(req.getRpcName())); + AppcLcmMessageWrapper appcreq = appcLcmRead.await(req -> APPC_RESTART_OP.equals(req.getRpcName())); topics.inject(APPC_LCM_WRITE_TOPIC, SERVICE123_APPC_RESTART_FAILURE, appcreq.getBody().getInput().getCommonHeader().getSubRequestId()); } // rebuild request should be sent and fail once - AppcLcmDmaapWrapper appcreq = appcLcmRead.await(req -> "rebuild".equals(req.getRpcName())); + AppcLcmMessageWrapper appcreq = appcLcmRead.await(req -> "rebuild".equals(req.getRpcName())); topics.inject(APPC_LCM_WRITE_TOPIC, SERVICE123_APPC_REBUILD_FAILURE, appcreq.getBody().getInput().getCommonHeader().getSubRequestId()); // migrate request should be sent and succeed @@ -258,7 +258,7 @@ public abstract class BaseTest { //TODO This test needs to be enabled in java-17 branch public void testDuplicatesEvents() { policyClMgt = createNoficationTopicListener(); - appcLcmRead = topics.createListener(APPC_LCM_READ_TOPIC, AppcLcmDmaapWrapper.class, APPC_LCM_CODER); + appcLcmRead = topics.createListener(APPC_LCM_READ_TOPIC, AppcLcmMessageWrapper.class, APPC_LCM_CODER); policy = checkPolicy(DUPLICATES_TOSCA_COMPLIANT_POLICY); @@ -275,7 +275,7 @@ public abstract class BaseTest { // should see two restarts for (var count = 0; count < 2; ++count) { - AppcLcmDmaapWrapper appcreq = appcLcmRead.await(req -> APPC_RESTART_OP.equals(req.getRpcName())); + AppcLcmMessageWrapper appcreq = appcLcmRead.await(req -> APPC_RESTART_OP.equals(req.getRpcName())); // indicate success topics.inject(APPC_LCM_WRITE_TOPIC, DUPLICATES_APPC_SUCCESS, @@ -422,7 +422,7 @@ public abstract class BaseTest { */ protected void appcLcmSunnyDay(String policyFile, List<String> onsetFiles, String operation) { policyClMgt = createNoficationTopicListener(); - appcLcmRead = topics.createListener(APPC_LCM_READ_TOPIC, AppcLcmDmaapWrapper.class, APPC_LCM_CODER); + appcLcmRead = topics.createListener(APPC_LCM_READ_TOPIC, AppcLcmMessageWrapper.class, APPC_LCM_CODER); policy = checkPolicy(policyFile); @@ -438,7 +438,7 @@ public abstract class BaseTest { /* * Ensure that an APPC RESTART request was sent in response to the matching ONSET */ - AppcLcmDmaapWrapper appcreq = appcLcmRead.await(req -> operation.equals(req.getRpcName())); + AppcLcmMessageWrapper appcreq = appcLcmRead.await(req -> operation.equals(req.getRpcName())); /* * Inject a 400 APPC Response Return over the APPC topic, with appropriate diff --git a/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/SimulatorException.java b/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/SimulatorException.java index f9880d07a..73dd2b348 100644 --- a/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/SimulatorException.java +++ b/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/SimulatorException.java @@ -3,6 +3,7 @@ * 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. @@ -20,10 +21,13 @@ package org.onap.policy.controlloop.common.rules.test; +import java.io.Serial; + /** * Exception thrown by <i>Simulators</i>. */ public class SimulatorException extends RuntimeException { + @Serial private static final long serialVersionUID = 1L; public SimulatorException() { diff --git a/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/Simulators.java b/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/Simulators.java index b1d3d544e..5e1a33d5a 100644 --- a/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/Simulators.java +++ b/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/Simulators.java @@ -3,6 +3,7 @@ * 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. @@ -57,7 +58,7 @@ public class Simulators { } /** - * Stops all of the simulators. + * Stops all the simulators. */ public void destroy() { for (HttpServletServer server : servers) { @@ -72,7 +73,7 @@ public class Simulators { } @FunctionalInterface - public static interface SimulatorBuilder { - public HttpServletServer build() throws InterruptedException; + public interface SimulatorBuilder { + HttpServletServer build() throws InterruptedException; } } |