RetrieveFeaturePropertyResponse extends AbstractCommandResponse<RetrieveFeaturePropertyResponse> implements ThingQueryCommandResponse<RetrieveFeaturePropertyResponse> { @Deprecated public static RetrieveFeaturePropertyResponse of(final String thingId, final String featureId, final JsonPointer featurePropertyPointer, final JsonValue featurePropertyValue, final DittoHeaders dittoHeaders) { return of(ThingId.of(thingId), featureId, featurePropertyPointer, featurePropertyValue, dittoHeaders); } private  RetrieveFeaturePropertyResponse(final ThingId thingId, final String featureId,
            final JsonPointer propertyPointer, final JsonValue propertyValue, final HttpStatusCode statusCode,
            final DittoHeaders dittoHeaders); @Deprecated static RetrieveFeaturePropertyResponse of(final String thingId, final String featureId,
            final JsonPointer featurePropertyPointer,
            final JsonValue featurePropertyValue, final DittoHeaders dittoHeaders); static RetrieveFeaturePropertyResponse of(final ThingId thingId, final String featureId,
            final JsonPointer featurePropertyPointer,
            final JsonValue featurePropertyValue, final DittoHeaders dittoHeaders); static RetrieveFeaturePropertyResponse fromJson(final String jsonString,
            final DittoHeaders dittoHeaders); static RetrieveFeaturePropertyResponse fromJson(final JsonObject jsonObject,
            final DittoHeaders dittoHeaders); @Override ThingId getThingEntityId(); String getFeatureId(); JsonPointer getPropertyPointer(); JsonValue getPropertyValue(); @Override JsonValue getEntity(final JsonSchemaVersion schemaVersion); @Override RetrieveFeaturePropertyResponse setEntity(final JsonValue entity); @Override RetrieveFeaturePropertyResponse 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 tryToCreateInstanceWithNullFeatureProperty() { RetrieveFeaturePropertyResponse.of(TestConstants.Thing.THING_ID, TestConstants.Feature.FLUX_CAPACITOR_ID, TestConstants.Feature.FLUX_CAPACITOR_PROPERTY_POINTER, null, TestConstants.EMPTY_DITTO_HEADERS); }
@Test public void toJsonReturnsExpected() { final RetrieveFeaturePropertyResponse underTest = RetrieveFeaturePropertyResponse.of( TestConstants.Thing.THING_ID, TestConstants.Feature.FLUX_CAPACITOR_ID, TestConstants.Feature.FLUX_CAPACITOR_PROPERTY_POINTER, TestConstants.Feature.FLUX_CAPACITOR_PROPERTY_VALUE, TestConstants.EMPTY_DITTO_HEADERS); final JsonObject actualJson = underTest.toJson(FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON); }
@Test(expected = JsonKeyInvalidException.class) public void tryToCreateInstanceWithInvalidArguments() { RetrieveFeaturePropertyResponse.of(TestConstants.Thing.THING_ID, TestConstants.Feature.FLUX_CAPACITOR_ID, INVALID_JSON_POINTER, TestConstants.Feature.FLUX_CAPACITOR_PROPERTY_VALUE, TestConstants.EMPTY_DITTO_HEADERS); }