RetrieveFeatureResponse extends AbstractCommandResponse<RetrieveFeatureResponse> implements
        ThingQueryCommandResponse<RetrieveFeatureResponse> { @Deprecated public static RetrieveFeatureResponse of(final String thingId, final String featureId, @Nullable final JsonObject jsonObject, final DittoHeaders dittoHeaders) { return of(ThingId.of(thingId), featureId, jsonObject, dittoHeaders); } private  RetrieveFeatureResponse(final ThingId thingId, final Feature feature, final DittoHeaders dittoHeaders); @Deprecated static RetrieveFeatureResponse of(final String thingId, final String featureId,
            @Nullable final JsonObject jsonObject, final DittoHeaders dittoHeaders); static RetrieveFeatureResponse of(final ThingId thingId, final String featureId,
            @Nullable final JsonObject jsonObject, final DittoHeaders dittoHeaders); @Deprecated static RetrieveFeatureResponse of(final String thingId, final Feature feature,
            final DittoHeaders dittoHeaders); static RetrieveFeatureResponse of(final ThingId thingId, final Feature feature,
            final DittoHeaders dittoHeaders); static RetrieveFeatureResponse fromJson(final String jsonString, final DittoHeaders dittoHeaders); static RetrieveFeatureResponse fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); @Override ThingId getThingEntityId(); String getFeatureId(); Feature getFeature(); @Override JsonObject getEntity(final JsonSchemaVersion schemaVersion); @Override RetrieveFeatureResponse setEntity(final JsonValue entity); @Override RetrieveFeatureResponse 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 tryToCreateInstanceWithNullFeature() { RetrieveFeatureResponse.of(TestConstants.Thing.THING_ID, null, TestConstants.EMPTY_DITTO_HEADERS); }
@Test public void toJsonReturnsExpected() { final RetrieveFeatureResponse underTest = RetrieveFeatureResponse.of(TestConstants.Thing.THING_ID, TestConstants.Feature.FLUX_CAPACITOR, TestConstants.EMPTY_DITTO_HEADERS); final JsonObject actualJson = underTest.toJson(FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON); }