RetrieveFeatureProperty extends AbstractCommand<RetrieveFeatureProperty> implements
        ThingQueryCommand<RetrieveFeatureProperty>, WithFeatureId { @Deprecated public static RetrieveFeatureProperty of(final String thingId, final String featureId, final JsonPointer propertyJsonPointer, final DittoHeaders dittoHeaders) { return of(ThingId.of(thingId), featureId, propertyJsonPointer, dittoHeaders); } private  RetrieveFeatureProperty(final ThingId thingId,
            final String featureId,
            final JsonPointer propertyPointer,
            final DittoHeaders dittoHeaders); @Deprecated static RetrieveFeatureProperty of(final String thingId,
            final String featureId,
            final JsonPointer propertyJsonPointer,
            final DittoHeaders dittoHeaders); static RetrieveFeatureProperty of(final ThingId thingId,
            final String featureId,
            final JsonPointer propertyJsonPointer,
            final DittoHeaders dittoHeaders); static RetrieveFeatureProperty fromJson(final String jsonString, final DittoHeaders dittoHeaders); static RetrieveFeatureProperty fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); JsonPointer getPropertyPointer(); @Override ThingId getThingEntityId(); @Override String getFeatureId(); @Override JsonPointer getResourcePath(); @Override RetrieveFeatureProperty setDittoHeaders(final DittoHeaders dittoHeaders); @Override int hashCode(); @SuppressWarnings("squid:MethodCyclomaticComplexity") @Override boolean equals(@Nullable final Object obj); @Override String toString(); static final String NAME; static final String TYPE; }
@Test(expected = ThingIdInvalidException.class) public void tryToCreateInstanceWithNullThingIdString() { RetrieveFeatureProperty.of((String) null, TestConstants.Feature.FLUX_CAPACITOR_ID, PROPERTY_JSON_POINTER, TestConstants.EMPTY_DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullThingId() { RetrieveFeatureProperty.of((ThingId) null, TestConstants.Feature.FLUX_CAPACITOR_ID, PROPERTY_JSON_POINTER, TestConstants.EMPTY_DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullFeatureId() { RetrieveFeatureProperty.of(TestConstants.Thing.THING_ID, null, PROPERTY_JSON_POINTER, TestConstants.EMPTY_DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullJsonPointer() { RetrieveFeatureProperty.of(TestConstants.Thing.THING_ID, TestConstants.Feature.FLUX_CAPACITOR_ID, null, TestConstants.EMPTY_DITTO_HEADERS); }
@Test public void tryToCreateInstanceWithValidArguments() { RetrieveFeatureProperty.of(TestConstants.Thing.THING_ID, TestConstants.Feature.FLUX_CAPACITOR_ID, PROPERTY_JSON_POINTER, TestConstants.EMPTY_DITTO_HEADERS); }
@Test public void jsonSerializationWorksAsExpected() { final RetrieveFeatureProperty underTest = RetrieveFeatureProperty.of(TestConstants.Thing.THING_ID, TestConstants.Feature.FLUX_CAPACITOR_ID, PROPERTY_JSON_POINTER, TestConstants.EMPTY_DITTO_HEADERS); final JsonObject actualJson = underTest.toJson(FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON); }
@Test(expected = JsonKeyInvalidException.class) public void tryToCreateInstanceWithInvalidArguments() { RetrieveFeatureProperty.of(TestConstants.Thing.THING_ID, TestConstants.Feature.FLUX_CAPACITOR_ID, INVALID_PROPERTY_JSON_POINTER, TestConstants.EMPTY_DITTO_HEADERS); }