SudoRetrieveThingsResponse extends AbstractCommandResponse<SudoRetrieveThingsResponse> implements
        SudoCommandResponse<SudoRetrieveThingsResponse> { public static SudoRetrieveThingsResponse of(final String thingsPlainJson, final DittoHeaders dittoHeaders) { return new SudoRetrieveThingsResponse(HttpStatusCode.OK, null, thingsPlainJson, dittoHeaders); } private  SudoRetrieveThingsResponse(final HttpStatusCode statusCode, @Nullable final JsonArray things,
            final String thingsPlainJson, final DittoHeaders dittoHeaders); static SudoRetrieveThingsResponse of(final String thingsPlainJson, final DittoHeaders dittoHeaders); static SudoRetrieveThingsResponse of(final List<String> thingsPlainJson, final DittoHeaders dittoHeaders); static SudoRetrieveThingsResponse of(final JsonArray things, final DittoHeaders dittoHeaders); static SudoRetrieveThingsResponse of(final List<Thing> things, final Predicate<JsonField> predicate,
            final DittoHeaders dittoHeaders); static SudoRetrieveThingsResponse of(final List<Thing> things, final JsonFieldSelector fieldSelector,
            final Predicate<JsonField> predicate, final DittoHeaders dittoHeaders); static SudoRetrieveThingsResponse fromJson(final String jsonString, final DittoHeaders dittoHeaders); static SudoRetrieveThingsResponse fromJson(final JsonObject jsonObject,
            final DittoHeaders dittoHeaders); List<Thing> getThings(); @Override JsonValue getEntity(final JsonSchemaVersion schemaVersion); @Override SudoRetrieveThingsResponse setEntity(final JsonValue entity); @Override SudoRetrieveThingsResponse 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(expected = NullPointerException.class) public void tryToCreateNewInstanceWithNullJsonArray() { SudoRetrieveThingsResponse.of(null, FieldType.notHidden(), EMPTY_DITTO_HEADERS); }
@Test public void responseStatusCodeIsOk() { final SudoRetrieveThingsResponse underTest = SudoRetrieveThingsResponse.of(KNOWN_THINGS, FieldType.notHidden(), EMPTY_DITTO_HEADERS); assertThat(underTest.getStatusCode()).isSameAs(HttpStatusCode.OK); }
@Test public void toJsonReturnsExpectedJson() { final SudoRetrieveThingsResponse underTest = SudoRetrieveThingsResponse.of(KNOWN_THINGS, FieldType.notHidden(), EMPTY_DITTO_HEADERS); final JsonObject actualJson = underTest.toJson(FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON); }