RetrieveThing extends AbstractCommand<RetrieveThing> implements ThingQueryCommand<RetrieveThing> { @Deprecated public static RetrieveThing of(final CharSequence thingId, final DittoHeaders dittoHeaders) { return of(ThingId.of(thingId), dittoHeaders); } private  RetrieveThing(final Builder builder); @Deprecated static RetrieveThing of(final CharSequence thingId, final DittoHeaders dittoHeaders); static RetrieveThing of(final ThingId thingId, final DittoHeaders dittoHeaders); @Deprecated static Builder getBuilder(final CharSequence thingId, final DittoHeaders dittoHeaders); static Builder getBuilder(final ThingId thingId, final DittoHeaders dittoHeaders); static RetrieveThing fromJson(final String jsonString, final DittoHeaders dittoHeaders); static RetrieveThing fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); @Override Optional<JsonFieldSelector> getSelectedFields(); @Override ThingId getThingEntityId(); @Override JsonPointer getResourcePath(); @Override RetrieveThing setDittoHeaders(final DittoHeaders dittoHeaders); @Nonnull Optional<Long> getSnapshotRevision(); @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 RetrieveThing underTest = RetrieveThing.of(TestConstants.Thing.THING_ID, DittoHeaders.empty()); final JsonObject actualJson = underTest.toJson(FieldType.regularOrSpecial()); assertThat(actualJson).isEqualTo(KNOWN_JSON); }