SearchSourceBuilder { public SearchSourceBuilder options(@Nullable final String options) { return validateAndSetSortOption(getEffectiveSortOption(options)); }  SearchSource build(); SearchSourceBuilder pubSubMediator(final ActorRef pubSubMediator); SearchSourceBuilder conciergeForwarder(final ActorRef conciergeForwarder); SearchSourceBuilder fields(@Nullable final JsonFieldSelector fields); SearchSourceBuilder fields(@Nullable final String fieldsString); SearchSourceBuilder filter(@Nullable final String filter); SearchSourceBuilder namespaces(@Nullable final JsonArray namespaces); SearchSourceBuilder namespaces(@Nullable final String namespacesString); SearchSourceBuilder sort(@Nullable final String sort); SearchSourceBuilder options(@Nullable final String options); SearchSourceBuilder sortValues(@Nullable final JsonArray sortValues); SearchSourceBuilder dittoHeaders(final DittoHeaders dittoHeaders); SearchSourceBuilder thingsAskTimeout(final Duration thingsAskTimeout); SearchSourceBuilder searchAskTimeout(final Duration searchAskTimeout); SearchSourceBuilder lastThingId(final String lastThingId);  }
@Test(expected = InvalidOptionException.class) public void failOnLimitOption() { SearchSource.newBuilder().options("limit(0,1)"); }
@Test(expected = InvalidOptionException.class) public void failOnCursorOption() { SearchSource.newBuilder().options("cursor(ABC)"); }
@Test(expected = InvalidOptionException.class) public void failOnInvalidSortFields() { SearchSource.newBuilder().options("sort(+invalid-sort-key)"); }
@Test(expected = InvalidOptionException.class) public void failOnInvalidSortFieldsAsOption() { SearchSource.newBuilder().options("sort(+invalid-sort-key)"); }