aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSingla, Rajiv (rs153v) <rs153v@att.com>2017-10-04 16:32:12 -0400
committerSingla, Rajiv (rs153v) <rs153v@att.com>2017-10-04 16:32:49 -0400
commitbff77d5302988e01a82bb3b224313cbb12123e5c (patch)
tree4983687d6b92639dbdfa1cb828c0d74fc720cccf
parent294cba47b07654e90b6be22e9b59b308d100243d (diff)
TCA: Get DMaaP pub/sub info from preferences
Change-Id: Ifb300fbd50dfe329590f74f6933118cab44b196c Signed-off-by: Singla, Rajiv (rs153v) <rs153v@att.com> Issue-Id: DCAEGEN2-123
-rw-r--r--dcae-analytics-cdap-tca/src/main/java/org/openecomp/dcae/apod/analytics/cdap/tca/utils/CDAPTCAUtils.java1
-rw-r--r--dcae-analytics-cdap-tca/src/test/java/org/openecomp/dcae/apod/analytics/cdap/tca/utils/CDAPTCAUtilsTest.java7
2 files changed, 7 insertions, 1 deletions
diff --git a/dcae-analytics-cdap-tca/src/main/java/org/openecomp/dcae/apod/analytics/cdap/tca/utils/CDAPTCAUtils.java b/dcae-analytics-cdap-tca/src/main/java/org/openecomp/dcae/apod/analytics/cdap/tca/utils/CDAPTCAUtils.java
index 986c301..8a16f0f 100644
--- a/dcae-analytics-cdap-tca/src/main/java/org/openecomp/dcae/apod/analytics/cdap/tca/utils/CDAPTCAUtils.java
+++ b/dcae-analytics-cdap-tca/src/main/java/org/openecomp/dcae/apod/analytics/cdap/tca/utils/CDAPTCAUtils.java
@@ -136,6 +136,7 @@ public abstract class CDAPTCAUtils extends TCAUtils {
if (null != tcaAppPreferences.getSubscriberHostName() || null != tcaAppPreferences.getPublisherHostName()) {
LOG.info("DMaaP Information is set from runtime preferences. Skipping getting DMaaP info from App Config");
+ return;
}
LOG.info("Fetching DMaaP information from App Configuration String: {}", appConfigString);
diff --git a/dcae-analytics-cdap-tca/src/test/java/org/openecomp/dcae/apod/analytics/cdap/tca/utils/CDAPTCAUtilsTest.java b/dcae-analytics-cdap-tca/src/test/java/org/openecomp/dcae/apod/analytics/cdap/tca/utils/CDAPTCAUtilsTest.java
index 2cb9002..7b4f72b 100644
--- a/dcae-analytics-cdap-tca/src/test/java/org/openecomp/dcae/apod/analytics/cdap/tca/utils/CDAPTCAUtilsTest.java
+++ b/dcae-analytics-cdap-tca/src/test/java/org/openecomp/dcae/apod/analytics/cdap/tca/utils/CDAPTCAUtilsTest.java
@@ -28,6 +28,8 @@ import org.openecomp.dcae.apod.analytics.cdap.tca.BaseAnalyticsCDAPTCAUnitTest;
import org.openecomp.dcae.apod.analytics.cdap.tca.settings.TCAAppPreferences;
import org.openecomp.dcae.apod.analytics.model.domain.policy.tca.TCAPolicy;
+import java.util.Map;
+
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
@@ -42,7 +44,10 @@ public class CDAPTCAUtilsTest extends BaseAnalyticsCDAPTCAUnitTest {
@Test
public void testGetValidatedTCAAppPreferences() throws Exception {
RuntimeContext runtimeContext = mock(RuntimeContext.class);
- when(runtimeContext.getRuntimeArguments()).thenReturn(getPreferenceMap());
+ final Map<String, String> preferenceMap = getPreferenceMap();
+ preferenceMap.remove("subscriberHostName");
+ preferenceMap.remove("publisherHostName");
+ when(runtimeContext.getRuntimeArguments()).thenReturn(preferenceMap);
ApplicationSpecification mockApplicationSpecification = Mockito.mock(ApplicationSpecification.class);
when(mockApplicationSpecification.getConfiguration()).thenReturn(fromStream(TCA_APP_CONFIG_FILE_LOCATION));
when(runtimeContext.getApplicationSpecification()).thenReturn(mockApplicationSpecification);