@GET
    @ApiOperation(value = "Retrieve a search query")
    @Path("{id}")
    @Produces({MediaType.APPLICATION_JSON, SEARCH_FORMAT_V1})
    public SearchDTO getSearch(@ApiParam(name = "id") @PathParam("id") String searchId, @Context SearchUser searchUser) {
        final Search search = searchDomain.getForUser(searchId, searchUser)
                .orElseThrow(() -> new NotFoundException("Search with id " + searchId + " does not exist"));
        return SearchDTO.fromSearch(search);
    }
@Test
    public void getSearchThrowsNotFoundIfSearchDoesntExist() {
        final SearchDomain searchDomain = mockSearchDomain(Optional.empty());
        final SearchResource resource = new SearchResource(searchDomain, searchExecutor, searchJobService, eventBus, clusterConfigService);
        assertThatExceptionOfType(NotFoundException.class)
                .isThrownBy(() -> resource.getSearch("god", searchUser))
                .withMessageContaining("god");
    }