1 package org.onap.ccsdk.sli.northbound.dmaapclient;
3 import static org.junit.Assert.*;
5 import java.util.LinkedList;
7 import java.util.Properties;
9 import org.junit.Before;
10 import org.junit.Test;
11 import org.slf4j.Logger;
12 import org.slf4j.LoggerFactory;
14 public class TestDmaapListener {
16 private static final String DMAAP_LISTENER_PROPERTIES = "dmaap-listener.properties";
17 private static final String DMAAP_LISTENER_PROPERTIES_DIR = "src/test/resources";
19 private static final Logger LOG = LoggerFactory.getLogger(TestDmaapListener.class);
22 public void setUp() throws Exception {
27 Properties properties = new Properties();
28 String propFileName = DMAAP_LISTENER_PROPERTIES;
29 String propPath = null;
30 String propDir = DMAAP_LISTENER_PROPERTIES_DIR;
32 List<SdncDmaapConsumer> consumers = new LinkedList<>();
35 propPath = propDir + "/" + propFileName;
37 if (propPath != null) {
38 properties = DmaapListener.loadProperties(propPath, properties);
40 String subscriptionStr = properties.getProperty("subscriptions");
42 boolean threadsRunning = false;
44 LOG.debug("Dmaap subscriptions : " + subscriptionStr);
46 if (subscriptionStr != null) {
47 threadsRunning = DmaapListener.handleSubscriptions(subscriptionStr, propDir, properties, consumers);