summaryrefslogtreecommitdiffstats
path: root/dmaap-listener
diff options
context:
space:
mode:
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