aboutsummaryrefslogtreecommitdiffstats
path: root/test/mocks/pnfsimulator/src/main/java
diff options
context:
space:
mode:
authorPawel Kadlubanski <pawel.kadlubanski@nokia.com>2018-05-28 11:34:50 +0200
committerPawel Kadlubanski <pawel.kadlubanski@nokia.com>2018-05-28 11:35:31 +0200
commitae2335539459822eda2abf66b6062aae0795ad24 (patch)
tree962305468f9fca658bae78d35c314e2724e2a942 /test/mocks/pnfsimulator/src/main/java
parentb2341a5b10c1dd57f19fdeb8fd19ed820dcaa2eb (diff)
Correction in created message.
Issue-ID: INT-458 Change-Id: Ic66e27bc89eea194769d54dd367a9a09d484d87f Signed-off-by: Pawel Kadlubanski <pawel.kadlubanski@nokia.com>
Diffstat (limited to 'test/mocks/pnfsimulator/src/main/java')
-rw-r--r--test/mocks/pnfsimulator/src/main/java/org/onap/pnfsimulator/message/MessageConstants.java3
-rw-r--r--test/mocks/pnfsimulator/src/main/java/org/onap/pnfsimulator/message/MessageProvider.java11
2 files changed, 9 insertions, 5 deletions
diff --git a/test/mocks/pnfsimulator/src/main/java/org/onap/pnfsimulator/message/MessageConstants.java b/test/mocks/pnfsimulator/src/main/java/org/onap/pnfsimulator/message/MessageConstants.java
index b49c1ea1d..5805a88c7 100644
--- a/test/mocks/pnfsimulator/src/main/java/org/onap/pnfsimulator/message/MessageConstants.java
+++ b/test/mocks/pnfsimulator/src/main/java/org/onap/pnfsimulator/message/MessageConstants.java
@@ -17,11 +17,12 @@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-
+
package org.onap.pnfsimulator.message;
public final class MessageConstants {
+ public static final String EVENT = "event";
public static final String DOMAIN = "domain";
public static final String EVENT_ID = "eventId";
public static final String EVENT_TYPE = "eventType";
diff --git a/test/mocks/pnfsimulator/src/main/java/org/onap/pnfsimulator/message/MessageProvider.java b/test/mocks/pnfsimulator/src/main/java/org/onap/pnfsimulator/message/MessageProvider.java
index 163d4e62d..94f5fc167 100644
--- a/test/mocks/pnfsimulator/src/main/java/org/onap/pnfsimulator/message/MessageProvider.java
+++ b/test/mocks/pnfsimulator/src/main/java/org/onap/pnfsimulator/message/MessageProvider.java
@@ -35,13 +35,12 @@ import static org.onap.pnfsimulator.message.MessageConstants.PRIORITY;
import static org.onap.pnfsimulator.message.MessageConstants.SEQUENCE;
import static org.onap.pnfsimulator.message.MessageConstants.START_EPOCH_MICROSEC;
import static org.onap.pnfsimulator.message.MessageConstants.VERSION;
+import static org.onap.pnfsimulator.message.MessageConstants.EVENT;
import java.util.Map;
import java.util.UUID;
import com.google.common.base.Preconditions;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
import org.json.JSONObject;
public class MessageProvider {
@@ -72,8 +71,11 @@ public class MessageProvider {
}
});
- root.put(COMMON_EVENT_HEADER, commonEventHeader);
- root.put(OTHER_FIELDS, otherFields);
+ JSONObject event = new JSONObject();
+ event.put(COMMON_EVENT_HEADER, commonEventHeader);
+ event.put(OTHER_FIELDS, otherFields);
+
+ root.put(EVENT, event);
return root;
}
@@ -91,6 +93,7 @@ public class MessageProvider {
commonEventHeader.put(START_EPOCH_MICROSEC, timestamp);
commonEventHeader.put(INTERNAL_HEADER_FIELDS, new JSONObject());
commonEventHeader.put(VERSION, 3);
+ commonEventHeader.put("functionalRole", "test_rola");
return commonEventHeader;
}