d1aee634d0cc6366bb9b5ca7acc22a02dad9b5b3
[ccsdk/sli.git] /
1 package org.onap.ccsdk.sli.northbound.dmaapclient; 
2  
3 import static org.junit.Assert.*; 
4  
5  
6 import java.io.File; 
7  
8 import org.junit.Before; 
9 import org.junit.Test; 
10  
11 public class SdncFlatJsonDmaapConsumerTest { 
12  
13         private static final String DMAAP_LISTENER_PROPERTIES = "dmaap-listener.properties"; 
14     private static final String DMAAP_LISTENER_PROPERTIES_DIR = "src/test/resources"; 
15  
16     SdncFlatJsonDmaapConsumer consumer; 
17  
18         @Before 
19         public void setUp() throws Exception { 
20                 consumer = new SdncFlatJsonDmaapConsumer(); 
21         } 
22  
23         @Test(expected = InvalidMessageException.class) 
24         public void testProcessMsgString_NullInvalidMessageException() throws InvalidMessageException { 
25                 // expected = InvalidMessageException: Null message 
26                 consumer.processMsg(null); 
27         } 
28  
29         @Test(expected = InvalidMessageException.class) 
30         public void testProcessMsgString_UnformatedMessageInvalidMessageException() throws InvalidMessageException { 
31                 // expected = InvalidMessageException: Cannot parse json object 
32                 consumer.processMsg("TESTING", null); 
33         } 
34  
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); 
40         } 
41 }