ThingErrorResponse extends AbstractErrorResponse<ThingErrorResponse> implements ThingCommandResponse<ThingErrorResponse> { public static ThingErrorResponse of(final DittoRuntimeException dittoRuntimeException) { return of(FALLBACK_THING_ID, dittoRuntimeException, dittoRuntimeException.getDittoHeaders()); } private  ThingErrorResponse(final ThingId thingId, final DittoRuntimeException dittoRuntimeException,
            final DittoHeaders dittoHeaders); static ThingErrorResponse of(final DittoRuntimeException dittoRuntimeException); @Deprecated static ThingErrorResponse of(final String thingId, final DittoRuntimeException dittoRuntimeException); static ThingErrorResponse of(final ThingId thingId, final DittoRuntimeException dittoRuntimeException); static ThingErrorResponse of(final DittoRuntimeException dittoRuntimeException,
            final DittoHeaders dittoHeaders); @Deprecated static ThingErrorResponse of(final String thingId, final DittoRuntimeException dittoRuntimeException,
            final DittoHeaders dittoHeaders); static ThingErrorResponse of(final ThingId thingId, final DittoRuntimeException dittoRuntimeException,
            final DittoHeaders dittoHeaders); static ThingErrorResponse fromJson(final String jsonString, final DittoHeaders dittoHeaders); static ThingErrorResponse fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); @Override ThingId getThingEntityId(); @Override DittoRuntimeException getDittoRuntimeException(); @Override JsonPointer getResourcePath(); @Override ThingErrorResponse setDittoHeaders(final DittoHeaders dittoHeaders); @SuppressWarnings("squid:S109") @Override int hashCode(); @SuppressWarnings("squid:MethodCyclomaticComplexity") @Override boolean equals(@Nullable final Object o); @Override String toString(); static final String TYPE; }
@Test public void toJsonReturnsExpected() { final ThingErrorResponse underTest = ThingErrorResponse.of(TestConstants.Thing.THING_ID, TestConstants.Thing.THING_NOT_ACCESSIBLE_EXCEPTION, TestConstants.EMPTY_DITTO_HEADERS); final JsonObject actualJsonCreated = underTest.toJson(FieldType.regularOrSpecial()); assertThat(actualJsonCreated).isEqualTo(KNOWN_JSON); }