CreateThingResponse extends AbstractCommandResponse<CreateThingResponse> implements
        ThingModifyCommandResponse<CreateThingResponse> { public static CreateThingResponse of(final Thing thing, final DittoHeaders dittoHeaders) { return new CreateThingResponse(thing, dittoHeaders); } private  CreateThingResponse(final Thing createdThing, final DittoHeaders dittoHeaders); static CreateThingResponse of(final Thing thing, final DittoHeaders dittoHeaders); static CreateThingResponse fromJson(final String jsonString, final DittoHeaders dittoHeaders); static CreateThingResponse fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); Optional<Thing> getThingCreated(); @Override ThingId getThingEntityId(); @Override Optional<JsonValue> getEntity(final JsonSchemaVersion schemaVersion); @Override JsonPointer getResourcePath(); @Override CreateThingResponse setDittoHeaders(final DittoHeaders dittoHeaders); @Override boolean equals(@Nullable final Object o); @Override int hashCode(); @Override String toString(); static final String TYPE; }
@Test public void toJsonReturnsExpected() { final CreateThingResponse underTestCreated = CreateThingResponse.of(TestConstants.Thing.THING, TestConstants.EMPTY_DITTO_HEADERS); final JsonObject actualJsonCreated = underTestCreated.toJson(FieldType.regularOrSpecial()); assertThat(actualJsonCreated).isEqualTo(KNOWN_JSON_CREATED); }