public SearchJob executeSync(String searchId, SearchUser searchUser, ExecutionState executionState) {
        return searchDomain.getForUser(searchId, searchUser)
                .map(s -> executeSync(s, searchUser, executionState))
                .orElseThrow(() -> new NotFoundException("No search found with id <" + searchId + ">."));
    }
@Test
    void appliesQueryStringDecoratorsOnSearchTypes() {
        final SearchUser searchUser = TestSearchUser.builder()
                .allowStream("foo")
                .build();
        final SearchType searchType = MessageList.builder()
                .id("searchType1")
                .query(ElasticsearchQueryString.of("*"))
                .build();
        final Search search = Search.builder()
                .queries(ImmutableSet.of(
                        Query.builder()
                                .query(ElasticsearchQueryString.of("*"))
                                .searchTypes(Collections.singleton(searchType))
                                .build()
                ))
                .build();

        final SearchJob searchJob = this.searchExecutor.executeSync(search, searchUser, ExecutionState.empty());

        final Query query = searchJob.getSearch().queries().stream().findFirst()
                .orElseThrow(() -> new AssertionError("Search unexpectedly contains no queries."));
        final SearchType resultingSearchType = query.searchTypes().stream().findFirst()
                .orElseThrow(() -> new AssertionError("Query unexpectedly contains no search types."));
        assertThat(resultingSearchType.query())
                .isPresent()
                .contains(ElasticsearchQueryString.of("decorated"));
    }