RetrieveFeaturesResponse extends AbstractCommandResponse<RetrieveFeaturesResponse> implements ThingQueryCommandResponse<RetrieveFeaturesResponse> { @Deprecated public static RetrieveFeaturesResponse of(final String thingId, final Features features, final DittoHeaders dittoHeaders) { return of(ThingId.of(thingId), features, dittoHeaders); } private  RetrieveFeaturesResponse(final ThingId thingId, final Features features, final DittoHeaders dittoHeaders); @Deprecated static RetrieveFeaturesResponse of(final String thingId, final Features features,
            final DittoHeaders dittoHeaders); static RetrieveFeaturesResponse of(final ThingId thingId, final Features features,
            final DittoHeaders dittoHeaders); @Deprecated static RetrieveFeaturesResponse of(final String thingId, @Nullable final JsonObject jsonObject,
            final DittoHeaders dittoHeaders); static RetrieveFeaturesResponse of(final ThingId thingId, @Nullable final JsonObject jsonObject,
            final DittoHeaders dittoHeaders); static RetrieveFeaturesResponse fromJson(final String jsonString, final DittoHeaders dittoHeaders); static RetrieveFeaturesResponse fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); @Override ThingId getThingEntityId(); Features getFeatures(); @Override JsonObject getEntity(final JsonSchemaVersion schemaVersion); @Override RetrieveFeaturesResponse setEntity(final JsonValue entity); @Override RetrieveFeaturesResponse setDittoHeaders(final DittoHeaders dittoHeaders); @Override JsonPointer getResourcePath(); @Override boolean equals(@Nullable final Object o); @Override int hashCode(); @Override String toString(); static final String TYPE; }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullFeatures() { RetrieveFeaturesResponse.of(TestConstants.Thing.THING_ID, (Features) null, TestConstants.EMPTY_DITTO_HEADERS); }
@Test public void toJsonReturnsExpected() { final RetrieveFeaturesResponse underTest = RetrieveFeaturesResponse.of(TestConstants.Thing.THING_ID, TestConstants.Feature.FEATURES, TestConstants.EMPTY_DITTO_HEADERS); final JsonObject actualJson = underTest.toJson(FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON); }