RetrieveFeatureProperties extends AbstractCommand<RetrieveFeatureProperties> implements
        ThingQueryCommand<RetrieveFeatureProperties>, WithFeatureId { @Deprecated public static RetrieveFeatureProperties of(final String thingId, final String featureId, final DittoHeaders dittoHeaders) { return of(ThingId.of(thingId), featureId, dittoHeaders); } private  RetrieveFeatureProperties(final ThingId thingId,
            final String featureId,
            @Nullable final JsonFieldSelector selectedFields,
            final DittoHeaders dittoHeaders); @Deprecated static RetrieveFeatureProperties of(final String thingId, final String featureId,
            final DittoHeaders dittoHeaders); static RetrieveFeatureProperties of(final ThingId thingId, final String featureId,
            final DittoHeaders dittoHeaders); @Deprecated static RetrieveFeatureProperties of(final String thingId,
            final String featureId,
            @Nullable final JsonFieldSelector selectedFields,
            final DittoHeaders dittoHeaders); static RetrieveFeatureProperties of(final ThingId thingId,
            final String featureId,
            @Nullable final JsonFieldSelector selectedFields,
            final DittoHeaders dittoHeaders); static RetrieveFeatureProperties fromJson(final String jsonString, final DittoHeaders dittoHeaders); static RetrieveFeatureProperties fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); @Override Optional<JsonFieldSelector> getSelectedFields(); @Override ThingId getThingEntityId(); @Override String getFeatureId(); @Override JsonPointer getResourcePath(); @Override RetrieveFeatureProperties setDittoHeaders(final DittoHeaders dittoHeaders); @Override int hashCode(); @SuppressWarnings("squid:S1067") @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() { RetrieveFeatureProperties.of((String) null, TestConstants.Feature.FLUX_CAPACITOR_ID, TestConstants.EMPTY_DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullThingId() { RetrieveFeatureProperties.of((ThingId) null, TestConstants.Feature.FLUX_CAPACITOR_ID, TestConstants.EMPTY_DITTO_HEADERS); }
@Test(expected = NullPointerException.class) public void tryToCreateInstanceWithNullFeatureId() { RetrieveFeatureProperties.of(TestConstants.Thing.THING_ID, null, TestConstants.EMPTY_DITTO_HEADERS); }
@Test public void tryToCreateInstanceWithValidArguments() { RetrieveFeatureProperties.of(TestConstants.Thing.THING_ID, TestConstants.Feature.FLUX_CAPACITOR_ID, TestConstants.EMPTY_DITTO_HEADERS); }
@Test public void toJsonReturnsExpected() { final RetrieveFeatureProperties underTest = RetrieveFeatureProperties.of(TestConstants.Thing.THING_ID, TestConstants.Feature.FLUX_CAPACITOR_ID, TestConstants.EMPTY_DITTO_HEADERS); final JsonObject actualJson = underTest.toJson(FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON); }
@Test public void jsonSerializationWorksAsExpectedWithSelectedFields() { final RetrieveFeatureProperties underTest = RetrieveFeatureProperties.of(TestConstants.Thing.THING_ID, TestConstants.Feature.FLUX_CAPACITOR_ID, JsonFactory.newFieldSelector(SELECTED_FIELDS, JSON_PARSE_OPTIONS), TestConstants.EMPTY_DITTO_HEADERS); final JsonObject actualJson = underTest.toJson(FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON_WITH_FIELD_SELECTION); }