SudoCountThings extends AbstractCommand<SudoCountThings> implements ThingSearchSudoCommand<SudoCountThings> { public static SudoCountThings of(@Nullable final String filter, final DittoHeaders dittoHeaders) { return new SudoCountThings(dittoHeaders, filter); } private  SudoCountThings(final DittoHeaders dittoHeaders, @Nullable final String filter); static SudoCountThings of(@Nullable final String filter, final DittoHeaders dittoHeaders); static SudoCountThings of(final DittoHeaders dittoHeaders); static SudoCountThings fromJson(final String jsonString, final DittoHeaders dittoHeaders); static SudoCountThings fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); Optional<String> getFilter(); @Override Category getCategory(); @Override SudoCountThings setDittoHeaders(final DittoHeaders dittoHeaders); @Override boolean equals(@Nullable final Object o); @Override int hashCode(); @Override String toString(); static final String NAME; static final String TYPE; }
@Test public void toJsonWithAllFieldsSetV2() { final SudoCountThings command = SudoCountThings.of(KNOWN_FILTER_STR, DittoHeaders.empty()); final String json = command.toJsonString(); assertThat(json).isEqualTo(JSON_ALL_FIELDS_V2); }
@Test public void toJsonWithAllFieldsSetV1() { final SudoCountThings command = SudoCountThings.of(KNOWN_FILTER_STR, DittoHeaders.empty()); final String json = command.toJsonString(JsonSchemaVersion.V_1, FieldType.regularOrSpecial()); assertThat(json).isEqualTo(JSON_ALL_FIELDS_V1); }
@Test public void toJsonWithOnlyRequiredFieldsSetV1() { final SudoCountThings command = SudoCountThings.of(DittoHeaders.empty()); final String json = command.toJsonString(JsonSchemaVersion.V_1, FieldType.regularOrSpecial()); assertThat(json).isEqualTo(JSON_MINIMAL_V1); }
@Test public void toJsonWithOnlyRequiredFieldsSetV2() { final SudoCountThings command = SudoCountThings.of(DittoHeaders.empty()); final String json = command.toJsonString(); assertThat(json).isEqualTo(JSON_MINIMAL_V2); }