Skip to content

Commit 3b81309

Browse files
modify resposne entity
1 parent d477ec2 commit 3b81309

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Diff for: protocol/src/test/java/org/eclipse/ditto/protocol/adapter/things/ThingMigrateCommandResponseAdapterTest.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ public void setUp() {
5252
@Test
5353
public void migrateThingResponseFromAdaptable() {
5454
final TopicPath topicPath = topicPath(TopicPath.Action.MIGRATE);
55-
56-
57-
5855
final MigrateThingDefinitionResponse migrateResponse = MigrateThingDefinitionResponse.applied(
5956
TestConstants.THING_ID,
6057
patch,
@@ -63,7 +60,7 @@ public void migrateThingResponseFromAdaptable() {
6360

6461
final Adaptable adaptableCreated = Adaptable.newBuilder(topicPath)
6562
.withPayload(Payload.newBuilder(JsonPointer.empty())
66-
.withValue(migrateResponse.getEntity().get())
63+
.withValue(migrateResponse.toJson())
6764
.withStatus(HttpStatus.OK)
6865
.build())
6966
.withHeaders(TestConstants.HEADERS_V_2)

Diff for: things/model/src/main/java/org/eclipse/ditto/things/model/signals/commands/modify/MigrateThingDefinitionResponse.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,11 @@ public MigrateThingDefinitionResponse setEntity(final JsonValue entity) {
273273

274274
@Override
275275
public Optional<JsonValue> getEntity(JsonSchemaVersion schemaVersion) {
276-
return Optional.of(this.toJson());
276+
return Optional.of(JsonObject.newBuilder()
277+
.set(JsonFields.JSON_THING_ID, thingId.toString())
278+
.set(JsonFields.JSON_PATCH, patch)
279+
.set(JsonFields.JSON_MERGE_STATUS, mergeStatus.name())
280+
.build());
277281
}
278282

279283
@Override

0 commit comments

Comments
 (0)