From 5d48bd15e1d799ba4419a8b6d960a089335b9852 Mon Sep 17 00:00:00 2001 From: rameshiyer27 Date: Tue, 11 Jun 2024 11:23:44 +0100 Subject: Add Sync topic for participant Intermediary Add new sync topic config for Intermediary Add sync topic listener Refactor IntermediaryActivator for processing multiple topic source Issue-ID: POLICY-5030 Change-Id: Idce9839a85571a92048e589bd82ce33699add640 Signed-off-by: zrrmmua --- .../kubernetes/parameters/CommonTestData.java | 24 ++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'participant/participant-impl/participant-impl-kubernetes/src/test/java/org') diff --git a/participant/participant-impl/participant-impl-kubernetes/src/test/java/org/onap/policy/clamp/acm/participant/kubernetes/parameters/CommonTestData.java b/participant/participant-impl/participant-impl-kubernetes/src/test/java/org/onap/policy/clamp/acm/participant/kubernetes/parameters/CommonTestData.java index b806cdbfd..3bb6009a8 100644 --- a/participant/participant-impl/participant-impl-kubernetes/src/test/java/org/onap/policy/clamp/acm/participant/kubernetes/parameters/CommonTestData.java +++ b/participant/participant-impl/participant-impl-kubernetes/src/test/java/org/onap/policy/clamp/acm/participant/kubernetes/parameters/CommonTestData.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2021-2023 Nordix Foundation. + * Copyright (C) 2021-2024 Nordix Foundation. * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -26,6 +26,7 @@ import java.util.List; import java.util.Map; import java.util.TreeMap; import java.util.UUID; +import org.onap.policy.clamp.acm.participant.intermediary.parameters.Topics; import org.onap.policy.clamp.models.acm.concepts.AcElementDeploy; import org.onap.policy.clamp.models.acm.messages.rest.instantiation.DeployOrder; import org.onap.policy.common.endpoints.parameters.TopicParameters; @@ -39,7 +40,8 @@ public class CommonTestData { public static final String PARTICIPANT_GROUP_NAME = "AutomationCompositionParticipantGroup"; public static final String DESCRIPTION = "Participant description"; public static final long TIME_INTERVAL = 2000; - public static final List TOPIC_PARAMS = List.of(getTopicParams()); + public static final List SINK_TOPIC_PARAMS = List.of(getTopicParams()); + public static final List SOURCE_TOPIC_PARAMS = List.of(getTopicParams(), getSyncTopicParams()); public static final Coder CODER = new StandardCoder(); private static final UUID AC_ID = UUID.randomUUID(); private static final String KEY_NAME = @@ -110,6 +112,7 @@ public class CommonTestData { map.put("participantId", getParticipantId()); map.put("clampAutomationCompositionTopics", getTopicParametersMap(false)); map.put("participantSupportedElementTypes", new ArrayList<>()); + map.put("topics", new Topics("policy-acruntime-participant", "acm-ppnt-sync")); } return map; @@ -133,8 +136,8 @@ public class CommonTestData { public Map getTopicParametersMap(final boolean isEmpty) { final Map map = new TreeMap<>(); if (!isEmpty) { - map.put("topicSources", TOPIC_PARAMS); - map.put("topicSinks", TOPIC_PARAMS); + map.put("topicSources", SOURCE_TOPIC_PARAMS); + map.put("topicSinks", SINK_TOPIC_PARAMS); } return map; } @@ -152,6 +155,19 @@ public class CommonTestData { return topicParams; } + /** + * Returns sync topic parameters for test cases. + * + * @return topic parameters + */ + public static TopicParameters getSyncTopicParams() { + final TopicParameters topicParams = new TopicParameters(); + topicParams.setTopic("acm-ppnt-sync"); + topicParams.setTopicCommInfrastructure("NOOP"); + topicParams.setServers(List.of("localhost")); + return topicParams; + } + /** * Get automation composition id. * @return UUID automationCompositionId -- cgit 1.2.3-korg