CreateSubscription extends AbstractCommand<CreateSubscription> implements ThingSearchQueryCommand<CreateSubscription> { public static CreateSubscription of(@Nullable final String filter, @Nullable final String options, @Nullable final JsonFieldSelector fields, @Nullable final Set<String> namespaces, final DittoHeaders dittoHeaders) { return new CreateSubscription(filter, options, fields, namespaces, null, dittoHeaders); } private  CreateSubscription(@Nullable final String filter,
            @Nullable final String options,
            @Nullable final JsonFieldSelector fields,
            @Nullable final Collection<String> namespaces,
            @Nullable final String prefix,
            final DittoHeaders dittoHeaders); static CreateSubscription of(@Nullable final String filter, @Nullable final String options,
            @Nullable final JsonFieldSelector fields, @Nullable final Set<String> namespaces,
            final DittoHeaders dittoHeaders); static CreateSubscription of(final DittoHeaders dittoHeaders); static CreateSubscription fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders); Optional<String> getFilter(); Optional<String> getOptions(); Optional<String> getPrefix(); @Override Optional<JsonFieldSelector> getSelectedFields(); @Override Optional<Set<String>> getNamespaces(); @Override CreateSubscription setNamespaces(@Nullable final Collection<String> namespaces); CreateSubscription setPrefix(@Nullable final String prefix); @Override CreateSubscription 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 toJsonWithOnlyRequiredFieldsSet() { final CreateSubscription command = CreateSubscription.of(DittoHeaders.empty()); final String json = command.toJsonString(); assertThat(json).isEqualTo(JSON_MINIMAL); }