blob: d1aee634d0cc6366bb9b5ca7acc22a02dad9b5b3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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);
}
}
|