Fix serialization of the "key" property 31/55331/1
authorMichael Arrastia <MArrasti@amdocs.com>
Mon, 25 Jun 2018 14:55:54 +0000 (15:55 +0100)
committerMichael Arrastia <MArrasti@amdocs.com>
Mon, 25 Jun 2018 14:55:54 +0000 (15:55 +0100)
commit4aec102f14f7cb837733c4d2b217e7fdc7088f86
tree6167d6b45a135f51db3dceb49deadf0d5bdc05e3
parent0edaac90429d84075ee01404166f29c666b3d107
Fix serialization of the "key" property

The introduction of a payload envelope to the update notification event
issued by champ-core caused the incorrect serialization of the "key"
property as a JSON object instead of a String.
This caused Spike to fail when parsing the notification event from
Champ as it expects "key" to be a String.

A previous fix attempt incorrectly addressed this problem. As the issue
originated from the inconsistent use of both Jackson and Gson JSON
libraries with the envelope using Gson but the contained objects
using Jackson annotations. This fix primarily involves updates to
champ-core to ensure that the envelope generation uses Jackson
instead of Gson and respects the original Jackson serialization of
the "key" property as a String.

Change-Id: I2a12732c9ff3970c3db9de5f0039304e68cb3556
Issue-ID: AAI-1243
Signed-off-by: Michael Arrastia <MArrasti@amdocs.com>
13 files changed:
champ-lib/champ-core/src/main/java/org/onap/aai/champcore/event/ChampEvent.java
champ-lib/champ-core/src/main/java/org/onap/aai/champcore/event/envelope/ChampEventEnvelope.java
champ-lib/champ-core/src/main/java/org/onap/aai/champcore/event/envelope/ChampEventHeader.java
champ-lib/champ-core/src/main/java/org/onap/aai/champcore/event/envelope/util/GsonUtil.java [deleted file]
champ-lib/champ-core/src/test/java/org/onap/aai/champcore/event/envelope/ChampEventEnvelopeTest.java
champ-lib/champ-core/src/test/resources/event/edge-event-envelope.json [new file with mode: 0644]
champ-lib/champ-core/src/test/resources/event/event-envelope-no-key.json [deleted file]
champ-lib/champ-core/src/test/resources/event/event-envelope-with-key.json [deleted file]
champ-lib/champ-core/src/test/resources/event/vertex-event-envelope-no-key.json [new file with mode: 0644]
champ-lib/champ-core/src/test/resources/event/vertex-event-envelope-with-key.json [new file with mode: 0644]
champ-service/src/main/java/org/onap/champ/async/ChampAsyncRequestProcessor.java
champ-service/src/main/java/org/onap/champ/event/envelope/GraphEventEnvelope.java
champ-service/src/main/java/org/onap/champ/event/envelope/GraphEventHeader.java [new file with mode: 0644]