--- /dev/null
+# SDN-C URL
+SDNC.endpoint => config-selfservice-api:notification-callback
+
+# Field mapping
+SDNC.template => template-generic-vnf.vt
--- /dev/null
+{
+ "input": {
+ "common-header": {
+ "request-id": "$event-header.id",
+ "timestamp": "$curr_time",
+ "originator-id": "AAI",
+ "api-ver": "2.00"
+ },
+ "action-identifiers": {
+ "action-name": "dmaap-notification",
+ "mode": "async"
+ },
+ "payload": $full_message
+ }
+}
\ No newline at end of file
"originator-id": "AAI",
"api-ver": "2.00"
},
+ "action-identifiers": {
+ "action-name": "dmaap-notification",
+ "mode": "async"
+ },
"payload": $full_message
}
}
\ No newline at end of file
package org.onap.ccsdk.sli.northbound.dmaapclient;
import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
import java.util.Properties;
import org.junit.Before;
import org.junit.Test;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
public class TestSdncPserverDmaapReceiver {
private static final String aaiInput = "{\r\n" +
" \"cambria.partition\": \"AAI\",\r\n" +
Properties props = new Properties();
String rpcMsgbody = new SdncAaiDmaapConsumer(props).publish("src/main/resources/template-pserver.vt", aaiInput);
+
+ ObjectMapper oMapper = new ObjectMapper();
+ JsonNode aaiRootNode;
+ try {
+ aaiRootNode = oMapper.readTree(rpcMsgbody);
+ } catch (Exception e) {
+ throw new InvalidMessageException("Cannot parse json object", e);
+ }
- assertTrue(rpcMsgbody.indexOf("input") != -1);
- assertTrue(rpcMsgbody.indexOf("payload") != -1);
- assertTrue(rpcMsgbody.indexOf("common-header") != -1);
+ assertTrue(aaiRootNode.get("input").get("payload") != null);
+ assertTrue(aaiRootNode.get("input").get("common-header") != null);
+
+ assertEquals(aaiRootNode.get("input").get("action-identifiers").get("action-name").textValue(), "dmaap-notification");
+ assertEquals(aaiRootNode.get("input").get("action-identifiers").get("mode").textValue(), "async");
}
--- /dev/null
+TransportType=DME2
+Latitude =47.778998
+Longitude =-122.182883
+Version =1.0
+ServiceName =dmaap-v1.dev.dmaap.dt.saat.acsi.att.com/events
+Environment =TEST
+Partner =
+SubContextPath =/
+Protocol =https
+MethodType =GET
+username =test
+password =test
+contenttype =application/json
+authKey=ABC123
+authDate=2016-05-10T13:13:50-0700
+host=localhost:3904
+topic=AAI-EVENT
+group=vnf
+id=1
+timeout=20000
+limit=10000
+filter={"class":"And","filters":[{"class":"Equals","field":"event-header.entity-type","value":"generic-vnf"},{"class":"Equals","field":"entity.vnf-type","value":"kvm-vpe"}]}
+AFT_DME2_EXCHANGE_REQUEST_HANDLERS=com.att.nsa.test.PreferredRouteRequestHandler
+AFT_DME2_EXCHANGE_REPLY_HANDLERS=com.att.nsa.test.PreferredRouteReplyHandler
+AFT_DME2_REQ_TRACE_ON=true
+AFT_ENVIRONMENT=AFTUAT
+AFT_DME2_EP_CONN_TIMEOUT=55000
+AFT_DME2_ROUNDTRIP_TIMEOUT_MS=240000
+AFT_DME2_EP_READ_TIMEOUT_MS=50000
+sessionstickinessrequired=NO
+DME2preferredRouterFilePath=src/test/resources/dmaap-listener.preferredRoute.txt
+sdnc.odl.user=admin
+sdnc.odl.password=admin
+sdnc.odl.url-base=http://localhost:8181/restconf/operations
\ No newline at end of file
authKey=ABC123
authDate=2016-05-10T13:13:50-0700
host=localhost:3904
-topic=ccsdk-topic
+topic=AAI-EVENT
group=pserver
id=1
timeout=20000