RetrieveFeatures extends AbstractCommand<RetrieveFeatures> implements ThingQueryCommand<RetrieveFeatures> { @Deprecated public static RetrieveFeatures of(final String thingId, final DittoHeaders dittoHeaders) { return of(ThingId.of(thingId), dittoHeaders); } private  RetrieveFeatures(final ThingId thingId, @Nullable final JsonFieldSelector theSelectedFields,
            final DittoHeaders dittoHeaders); @Deprecated static RetrieveFeatures of(final String thingId, final DittoHeaders dittoHeaders); static RetrieveFeatures of(final ThingId thingId, final DittoHeaders dittoHeaders); @Deprecated static RetrieveFeatures of(final String thingId, @Nullable final JsonFieldSelector selectedFields,
            final DittoHeaders dittoHeaders); static RetrieveFeatures of(final ThingId thingId, @Nullable final JsonFieldSelector selectedFields,
            final DittoHeaders dittoHeaders); static RetrieveFeatures fromJson(final String jsonString, final DittoHeaders dittoHeaders); static RetrieveFeatures fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); @Override Optional<JsonFieldSelector> getSelectedFields(); @Override ThingId getThingEntityId(); @Override JsonPointer getResourcePath(); @Override RetrieveFeatures setDittoHeaders(final DittoHeaders dittoHeaders); @Override int hashCode(); @SuppressWarnings({"squid:MethodCyclomaticComplexity", "squid:S1067", "OverlyComplexMethod"}) @Override boolean equals(@Nullable final Object obj); @Override String toString(); static final String NAME; static final String TYPE; }
@Test public void toJsonReturnsExpected() { final RetrieveFeatures underTest = RetrieveFeatures.of(TestConstants.Thing.THING_ID, TestConstants.EMPTY_DITTO_HEADERS); final JsonObject actualJson = underTest.toJson(FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON); }
@Test public void jsonSerializationWorksAsExpectedWithSelectedFields() { final RetrieveFeatures underTest = RetrieveFeatures.of(TestConstants.Thing.THING_ID, getJsonFieldSelector(), TestConstants.EMPTY_DITTO_HEADERS); final JsonObject actualJson = underTest.toJson(FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON_WITH_FIELD_SELECTION); }