1 package org.onap.ccsdk.sli.northbound.dmaapclient;
3 import static org.junit.Assert.*;
8 import org.junit.Before;
11 public class SdncFlatJsonDmaapConsumerTest {
13 private static final String DMAAP_LISTENER_PROPERTIES = "dmaap-listener.properties";
14 private static final String DMAAP_LISTENER_PROPERTIES_DIR = "src/test/resources";
16 SdncFlatJsonDmaapConsumer consumer;
19 public void setUp() throws Exception {
20 consumer = new SdncFlatJsonDmaapConsumer();
23 @Test(expected = InvalidMessageException.class)
24 public void testProcessMsgString_NullInvalidMessageException() throws InvalidMessageException {
25 // expected = InvalidMessageException: Null message
26 consumer.processMsg(null);
29 @Test(expected = InvalidMessageException.class)
30 public void testProcessMsgString_UnformatedMessageInvalidMessageException() throws InvalidMessageException {
31 // expected = InvalidMessageException: Cannot parse json object
32 consumer.processMsg("TESTING", null);
35 @Test(expected = InvalidMessageException.class)
36 public void testing()throws InvalidMessageException {
37 // Expected = InvalidMessageException: Unable to process message - cannot load field mappings
38 String msg = "{\"test\":\"string\"}";
39 consumer.processMsg(msg, null);