@Test
public void searchWithQueryParameters() {

    final String filter = "not(exists(thingId))";
    final String option = "sort(-policyId)";
    final String namespaces = "a,b,c";
    final String url = SEARCH_ROUTE + "?filter=" + filter + "&option=" + option + "&namespaces=" + namespaces;
    final TestRouteResult routeResult = underTest.run(HttpRequest.GET(url).addHeader(acceptHeader));
    final CompletableFuture<Void> assertions =
            CompletableFuture.runAsync(() -> {
                routeResult.assertMediaType(MediaTypes.TEXT_EVENT_STREAM);
                routeResult.assertStatusCode(StatusCodes.OK);
            });
    final StreamThings streamThings = proxyActor.expectMsgClass(StreamThings.class);
    replySourceRef(proxyActor, Source.lazily(Source::empty));
    assertions.join();
    assertThat(streamThings.getFilter()).contains(filter);
    assertThat(streamThings.getNamespaces()).contains(Set.of("a", "b", "c"));
    // sort options are parsed and appended with +/thingId
    assertThat(streamThings.getSort()).contains("sort(-/policyId,+/thingId)");
}