summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuangrongFu <fu.guangrong@zte.com.cn>2020-10-22 19:02:27 +0800
committerGuangrongFu <fu.guangrong@zte.com.cn>2020-10-22 19:02:45 +0800
commit8fe3168b910b5088d4874890961a26792b6d7325 (patch)
tree1d721f383b792d34f5173754b478b8694eb5c7c6
parent59d22c8f5ed81e1221ee6e9c5364a8baf5bc3a20 (diff)
Added Some Debugging Logs
Change-Id: I15bb6ada02424a65884522e4a2727fac29d2162a Issue-ID: HOLMES-369 Signed-off-by: GuangrongFu <fu.guangrong@zte.com.cn>
-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()));
}