{
context.put((String)key, jsonObj.get((String)key));
}
+
+ String id = jsonObj.getJSONObject(EVENT_HEADER).get("id").toString();
+ context.put("req_id", id);
context.put("curr_time", Instant.now());
String odlPassword = getProperty("sdnc.odl.password");
if ((odlUrlBase != null) && (odlUrlBase.length() > 0)) {
- SdncOdlConnection conn = SdncOdlConnection.newInstance(odlUrlBase + sdncEndpoint, odlUser, odlPassword);
+ SdncOdlConnection conn = SdncOdlConnection.newInstance(odlUrlBase + "/" + sdncEndpoint, odlUser, odlPassword);
conn.send("POST", "application/json", rpcMsgbody);
} else {
{
"input": {
"common-header": {
- "request-id": "$event-header.id",
+ "request-id": "$req_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
{
"input": {
"common-header": {
- "request-id": "$event-header.id",
+ "request-id": "$req_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
package org.onap.ccsdk.sli.northbound.dmaapclient;
import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertEquals;
import java.io.File;
import java.io.IOException;
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");
}
@Test