SudoRetrieveThingResponse extends AbstractCommandResponse<SudoRetrieveThingResponse> implements SudoCommandResponse<SudoRetrieveThingResponse> { public static SudoRetrieveThingResponse of(final JsonObject thing, final DittoHeaders dittoHeaders) { return new SudoRetrieveThingResponse(HttpStatusCode.OK, thing, dittoHeaders); } private  SudoRetrieveThingResponse(final HttpStatusCode statusCode, final JsonObject thing,
            final DittoHeaders dittoHeaders); static SudoRetrieveThingResponse of(final JsonObject thing, final DittoHeaders dittoHeaders); static SudoRetrieveThingResponse fromJson(final String jsonString, final DittoHeaders dittoHeaders); static SudoRetrieveThingResponse fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); Thing getThing(); @Override JsonValue getEntity(final JsonSchemaVersion schemaVersion); @Override SudoRetrieveThingResponse setEntity(final JsonValue entity); @Override SudoRetrieveThingResponse setDittoHeaders(final DittoHeaders dittoHeaders); @Override int hashCode(); @SuppressWarnings({"squid:MethodCyclomaticComplexity", "squid:S1067", "pmd:SimplifyConditional"}) @Override boolean equals(@Nullable final Object o); @Override String toString(); static final String NAME; static final String TYPE; }
@Test public void toJsonReturnsExpected() { final JsonObject thingJson = THING.toJson(FieldType.notHidden()); final SudoRetrieveThingResponse underTest = SudoRetrieveThingResponse.of(thingJson, EMPTY_DITTO_HEADERS); final JsonObject actualJson = underTest.toJson(FieldType.notHidden()); assertThat(actualJson).isEqualTo(KNOWN_JSON); }