943ef02042e9c4d53244e0491643962856c1977d
[ccsdk/sli.git] /
1 package org.onap.ccsdk.sli.northbound.dmaapclient;
2
3 import static org.junit.Assert.*;
4
5 import java.util.LinkedList;
6 import java.util.List;
7 import java.util.Properties;
8
9 import org.junit.Before;
10 import org.junit.Test;
11 import org.slf4j.Logger;
12 import org.slf4j.LoggerFactory;
13
14 public class TestDmaapListener {
15
16         private static final String DMAAP_LISTENER_PROPERTIES = "dmaap-listener.properties";
17         private static final String DMAAP_LISTENER_PROPERTIES_DIR = "src/test/resources";
18
19         private static final Logger LOG = LoggerFactory.getLogger(TestDmaapListener.class);
20
21         @Before
22         public void setUp() throws Exception {
23         }
24
25         @Test
26         public void test() {
27                 Properties properties = new Properties();
28                 String propFileName = DMAAP_LISTENER_PROPERTIES;
29                 String propPath = null;
30                 String propDir = DMAAP_LISTENER_PROPERTIES_DIR;
31
32                 List<SdncDmaapConsumer> consumers = new LinkedList<>();
33
34
35                 propPath = propDir + "/" + propFileName;
36
37                 if (propPath != null) {
38                         properties = DmaapListener.loadProperties(propPath, properties);
39
40                         String subscriptionStr = properties.getProperty("subscriptions");
41
42                         boolean threadsRunning = false;
43
44                         LOG.debug("Dmaap subscriptions : " + subscriptionStr);
45
46                         if (subscriptionStr != null) {
47                                 threadsRunning = DmaapListener.handleSubscriptions(subscriptionStr, propDir, properties, consumers);
48                         }
49                 }
50         }
51
52 }