JooqBatchSearchRepository implements BatchSearchRepository { @Override public BatchSearch get(String id) { Optional<BatchSearch> batchSearches = mergeBatchSearches( createBatchSearchWithQueriesSelectStatement(using(dataSource, dialect)).where(BATCH_SEARCH.UUID.eq(id)). fetch().stream().map(this::createBatchSearchFrom).collect(toList())).stream().findFirst(); return batchSearches.orElseThrow(() -> new BatchNotFoundException(id)); } JooqBatchSearchRepository(final DataSource dataSource, final SQLDialect dialect); @Override boolean save(final BatchSearch batchSearch); @Override boolean saveResults(String batchSearchId, String query, List<Document> documents); @Override boolean setState(String batchSearchId, State state); @Override boolean setState(String batchSearchId, SearchException error); @Override boolean deleteAll(User user); @Override boolean delete(User user, String batchId); @Override BatchSearch get(String id); @Override List<BatchSearchRecord> getRecords(User user, List<String> projectsIds); @Override int getTotal(User user, List<String> projectsIds); @Override List<BatchSearchRecord> getRecords(User user, List<String> projectsIds, WebQuery webQuery); @Override BatchSearch get(User user, String batchId); @Override List<BatchSearch> getQueued(); @Override List<SearchResult> getResults(final User user, String batchSearchId); @Override List<SearchResult> getResults(User user, String batchSearchId, WebQuery webQuery); @Override boolean publish(User user, String batchId, boolean published); @Override void close();  }
@Test(expected = JooqBatchSearchRepository.BatchNotFoundException.class) public void test_get_search_by_id_not_found() { repository.get("uuid"); }