summaryrefslogtreecommitdiffstats
path: root/holmes-actions/src
diff options
context:
space:
mode:
Diffstat (limited to 'holmes-actions/src')
-rw-r--r--holmes-actions/src/main/java/org/onap/holmes/common/dcae/DcaeConfigurationsCache.java5
-rw-r--r--holmes-actions/src/main/java/org/onap/holmes/common/dmaap/DmaapService.java3
-rw-r--r--holmes-actions/src/test/java/org/onap/holmes/common/dcae/DcaeConfigurationsCacheTest.java1
3 files changed, 8 insertions, 1 deletions
diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/dcae/DcaeConfigurationsCache.java b/holmes-actions/src/main/java/org/onap/holmes/common/dcae/DcaeConfigurationsCache.java
index 2503ce2..2dd5ac5 100644
--- a/holmes-actions/src/main/java/org/onap/holmes/common/dcae/DcaeConfigurationsCache.java
+++ b/holmes-actions/src/main/java/org/onap/holmes/common/dcae/DcaeConfigurationsCache.java
@@ -18,6 +18,7 @@ package org.onap.holmes.common.dcae;
import lombok.extern.slf4j.Slf4j;
import org.onap.holmes.common.dcae.entity.DcaeConfigurations;
import org.onap.holmes.common.dcae.entity.SecurityInfo;
+import org.onap.holmes.common.utils.GsonUtil;
@Slf4j
public class DcaeConfigurationsCache {
@@ -40,4 +41,8 @@ public class DcaeConfigurationsCache {
public synchronized static void setDcaeConfigurations(DcaeConfigurations configurations) {
dcaeConfigurations = configurations;
}
+
+ public synchronized static String getDcaeConfigurations() {
+ return GsonUtil.beanToJson(dcaeConfigurations);
+ }
}
diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/DmaapService.java b/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/DmaapService.java
index f29f1d9..7e33bf9 100644
--- a/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/DmaapService.java
+++ b/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/DmaapService.java
@@ -71,7 +71,8 @@ public class DmaapService {
} catch (CorrelationException e) {
log.error("Failed to publish the control loop event to DMaaP", e);
} catch (NullPointerException e) {
- log.error("DMaaP configurations do not exist!");
+ log.error(String.format("DMaaP configurations do not exist!\n DCAE Configurations: \n %s",
+ DcaeConfigurationsCache.getDcaeConfigurations()), e);
}
}
diff --git a/holmes-actions/src/test/java/org/onap/holmes/common/dcae/DcaeConfigurationsCacheTest.java b/holmes-actions/src/test/java/org/onap/holmes/common/dcae/DcaeConfigurationsCacheTest.java
index d1a3dcb..11a112c 100644
--- a/holmes-actions/src/test/java/org/onap/holmes/common/dcae/DcaeConfigurationsCacheTest.java
+++ b/holmes-actions/src/test/java/org/onap/holmes/common/dcae/DcaeConfigurationsCacheTest.java
@@ -37,6 +37,7 @@ public class DcaeConfigurationsCacheTest {
securityInfo.setAafUsername("tset11");
dcaeConfigurations.addPubSecInfo("test", securityInfo);
DcaeConfigurationsCache.setDcaeConfigurations(dcaeConfigurations);
+ System.out.println(DcaeConfigurationsCache.getDcaeConfigurations());
assertThat(DcaeConfigurationsCache.getPubSecInfo("test").getAafUsername(),
equalTo(securityInfo.getAafUsername()));
}