Skip to content

Commit

Permalink
fixed NormalizedMessageMapperTest, including new "value" field to exp…
Browse files Browse the repository at this point in the history
…ectations

Signed-off-by: Thomas Jäckle <thomas.jaeckle@beyonnex.io>
  • Loading branch information
thjaeckle committed Oct 15, 2023
1 parent 3cc6bb9 commit 4404e59
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.time.Instant;
import java.util.Map;

import org.apache.pekko.actor.ActorSystem;
import org.assertj.core.api.Assertions;
import org.eclipse.ditto.base.model.headers.DittoHeaders;
import org.eclipse.ditto.base.model.signals.Signal;
Expand Down Expand Up @@ -46,7 +47,6 @@
import org.eclipse.ditto.things.model.FeatureProperties;
import org.eclipse.ditto.things.model.Features;
import org.eclipse.ditto.things.model.Thing;
import org.eclipse.ditto.things.model.ThingDefinition;
import org.eclipse.ditto.things.model.ThingId;
import org.eclipse.ditto.things.model.ThingsModelFactory;
import org.eclipse.ditto.things.model.signals.commands.modify.DeleteThing;
Expand All @@ -67,8 +67,6 @@
import com.typesafe.config.Config;
import com.typesafe.config.ConfigFactory;

import org.apache.pekko.actor.ActorSystem;

/**
* Tests {@link NormalizedMessageMapper}.
*/
Expand Down Expand Up @@ -133,6 +131,7 @@ public void thingCreated() {
" \"_context\": {\n" +
" \"topic\": \"thing/created/things/twin/events/created\",\n" +
" \"path\": \"/\",\n" +
" \"value\":{\"thingId\":\"thing:created\",\"policyId\":\"thing:created\",\"attributes\":{\"x\":5},\"features\":{\"feature\":{\"properties\":{\"y\":6}}}},\n" +
" \"headers\": {\n" +
" \"response-required\": \"false\",\n" +
" \"content-type\": \"application/json\"\n" +
Expand Down Expand Up @@ -174,6 +173,7 @@ public void thingMerged() {
" \"_context\": {\n" +
" \"topic\": \"thing/merged/things/twin/events/merged\",\n" +
" \"path\": \"/\",\n" +
" \"value\":{\"thingId\":\"thing:merged\",\"attributes\":{\"x\":5},\"features\":{\"feature\":{\"properties\":{\"y\":6}}}},\n" +
" \"headers\": {\n" +
" \"response-required\": \"false\",\n" +
" \"content-type\": \"application/merge-patch+json\"\n" +
Expand Down Expand Up @@ -218,6 +218,7 @@ public void thingMergedWithNullValues() {
" \"_context\": {\n" +
" \"topic\": \"thing/merged/things/twin/events/merged\",\n" +
" \"path\": \"/\",\n" +
" \"value\":{\"thingId\":\"thing:merged\",\"attributes\":{\"x\":5},\"features\":{\"feature\":{\"properties\":{\"y\":6}}}},\n" +
" \"headers\": {\n" +
" \"response-required\": \"false\",\n" +
" \"content-type\": \"application/merge-patch+json\"\n" +
Expand Down Expand Up @@ -251,6 +252,7 @@ public void thingMergedWithOnlyNullValues() {
" \"_context\": {\n" +
" \"topic\": \"thing/merged/things/twin/events/merged\",\n" +
" \"path\": \"/\",\n" +
" \"value\":{\"thingId\":\"thing:merged\"},\n" +
" \"headers\": {\n" +
" \"response-required\": \"false\",\n" +
" \"content-type\": \"application/merge-patch+json\"\n" +
Expand Down Expand Up @@ -309,6 +311,7 @@ public void thingMergedWithExtraFields() {
.set("_context", JsonObject.newBuilder()
.set("topic", "the.namespace/the-thing-id/things/twin/events/merged")
.set("path", "/features/transmission")
.set("value", JsonFactory.readFrom("{\"properties\":{\"cur_speed\":80}}"))
.set("headers", JsonObject.newBuilder()
.set("response-required", "false")
.set("content-type", "application/merge-patch+json")
Expand Down Expand Up @@ -345,6 +348,7 @@ public void featurePropertyModified() {
" \"_context\": {\n" +
" \"topic\": \"thing/id/things/twin/events/modified\",\n" +
" \"path\": \"/features/featureId/properties/the/quick/brown/fox/jumps/over/the/lazy/dog\",\n" +
" \"value\":9,\n" +
" \"headers\": {\n" +
" \"response-required\": \"false\",\n" +
" \"content-type\": \"application/json\"\n" +
Expand Down

0 comments on commit 4404e59

Please sign in to comment.