summaryrefslogtreecommitdiffstats
path: root/dmaap-listener
diff options
context:
space:
mode:
authorJeremy Wolf <jw720x@us.att.com>2018-03-28 17:22:09 +0000
committerJeremy Wolf <jw720x@us.att.com>2018-03-28 17:22:09 +0000
commitc50170bc44f192a7c8e7efdfc773342d8b5c0437 (patch)
tree0a65234525d6d8eddd926c478537fa3ea46aa7dd /dmaap-listener
parent7ee6690d42bdfbc1685b1ea1c40dc4015bd271e8 (diff)
coverage sli-northbound
adding junit test files for AsdcApiSliClient, AsdcApiUtil, DataChangeClient, SdncFlatJsonDmaapConsumer, SdncARModel, SdncNodeModel, SdncVFCModel, SdncVFModuleModel, SdncUebCallback Change-Id: Ia7fb307b84957292f9080654c7ae31992434317f Issue-ID: CCSDK-230 Signed-off-by: Jeremy Wolf <jw720x@us.att.com>
Diffstat (limited to 'dmaap-listener')
-rw-r--r--dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncFlatJsonDmaapConsumerTest.java41
1 files changed, 41 insertions, 0 deletions
diff --git a/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncFlatJsonDmaapConsumerTest.java b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncFlatJsonDmaapConsumerTest.java
new file mode 100644
index 000000000..d1aee634d
--- /dev/null
+++ b/dmaap-listener/src/test/java/org/onap/ccsdk/sli/northbound/dmaapclient/SdncFlatJsonDmaapConsumerTest.java
@@ -0,0 +1,41 @@
+package org.onap.ccsdk.sli.northbound.dmaapclient;
+
+import static org.junit.Assert.*;
+
+
+import java.io.File;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class SdncFlatJsonDmaapConsumerTest {
+
+ private static final String DMAAP_LISTENER_PROPERTIES = "dmaap-listener.properties";
+ private static final String DMAAP_LISTENER_PROPERTIES_DIR = "src/test/resources";
+
+ SdncFlatJsonDmaapConsumer consumer;
+
+ @Before
+ public void setUp() throws Exception {
+ consumer = new SdncFlatJsonDmaapConsumer();
+ }
+
+ @Test(expected = InvalidMessageException.class)
+ public void testProcessMsgString_NullInvalidMessageException() throws InvalidMessageException {
+ // expected = InvalidMessageException: Null message
+ consumer.processMsg(null);
+ }
+
+ @Test(expected = InvalidMessageException.class)
+ public void testProcessMsgString_UnformatedMessageInvalidMessageException() throws InvalidMessageException {
+ // expected = InvalidMessageException: Cannot parse json object
+ consumer.processMsg("TESTING", null);
+ }
+
+ @Test(expected = InvalidMessageException.class)
+ public void testing()throws InvalidMessageException {
+ // Expected = InvalidMessageException: Unable to process message - cannot load field mappings
+ String msg = "{\"test\":\"string\"}";
+ consumer.processMsg(msg, null);
+ }
+} \ No newline at end of file