From 4c1c6891ed6cd4a9e5c2e0b3bacd0c2df89364a7 Mon Sep 17 00:00:00 2001 From: Jorge Hernandez Date: Tue, 19 Feb 2019 20:05:31 -0600 Subject: Support for lab contextual topic names. This work allows a drools application, with its drl template to refer to the topic name by its invariable canonical name, ie. POLICY-CL-MGT. Since the drl is a design time artifact, it is desired to know topics by its canonical non-changeable name. The actual per lab environment topic name may change on a per deployment basis, for example POLICY-CL-MGT-WINDRIVER or POLICY-CL-MGT-TLAB. The template can still use POLICY-CL-MGT without modification but the actual installation configuration would use the "effectiveTopic" property to point to the right topic on a per lab basis. This also helps with installation (long story) since the canonical topics will be known ahead of time. Change-Id: I8322bf7e427569c37a76eea5ce6d5b9547cb2ff3 Issue-ID: POLICY-1534 Signed-off-by: Jorge Hernandez --- .../endpoints/event/comm/bus/internal/BusTopicBaseTest.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusTopicBaseTest.java') diff --git a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusTopicBaseTest.java b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusTopicBaseTest.java index 83a94bd5..5628a239 100644 --- a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusTopicBaseTest.java +++ b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/event/comm/bus/internal/BusTopicBaseTest.java @@ -22,6 +22,7 @@ package org.onap.policy.common.endpoints.event.comm.bus.internal; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; @@ -76,6 +77,13 @@ public class BusTopicBaseTest extends TopicTestBase { assertEquals(false, new BusTopicBaseImpl(builder.allowSelfSignedCerts(false).build()).isAllowSelfSignedCerts()); } + @Test + public void testTopic() { + assertEquals(MY_TOPIC, base.getTopic()); + assertEquals(MY_EFFECTIVE_TOPIC, base.getEffectiveTopic()); + assertNotEquals(base.getTopic(), base.getEffectiveTopic()); + } + @Test public void testAnyNullOrEmpty() { assertFalse(base.anyNullOrEmpty()); -- cgit 1.2.3-korg