@Test(expected=NullPointerException.class) public void search_searchFilterNull() { judgmentEnrichmentDbSearchService.search(null); }
public SearchResult<Judgment> search(JudgmentSearchFilter searchFilter) { Preconditions.checkNotNull(searchFilter); SearchResult<Judgment> searchResult = databaseSearchService.search(searchFilter); if (searchFilter.isWithGenerated() != null && !searchFilter.isWithGenerated()) { return searchResult; } if (CollectionUtils.isEmpty(searchResult.getResultRecords())) { return searchResult; } List<Judgment> judgments = searchResult.getResultRecords(); List<EnrichmentTag> enrichmentTags = enrichmentTagRepository.findAllByJudgmentIds(extractJudgmentIds(judgments)); for (Judgment judgment : judgments) { List<EnrichmentTag> judgmentEnrichmentTags = extractEnrichmentTags(enrichmentTags, judgment); judgmentEnrichmentService.enrich(judgment, judgmentEnrichmentTags); } return searchResult; }
JudgmentEnrichmentDbSearchService { public SearchResult<Judgment> search(JudgmentSearchFilter searchFilter) { Preconditions.checkNotNull(searchFilter); SearchResult<Judgment> searchResult = databaseSearchService.search(searchFilter); if (searchFilter.isWithGenerated() != null && !searchFilter.isWithGenerated()) { return searchResult; } if (CollectionUtils.isEmpty(searchResult.getResultRecords())) { return searchResult; } List<Judgment> judgments = searchResult.getResultRecords(); List<EnrichmentTag> enrichmentTags = enrichmentTagRepository.findAllByJudgmentIds(extractJudgmentIds(judgments)); for (Judgment judgment : judgments) { List<EnrichmentTag> judgmentEnrichmentTags = extractEnrichmentTags(enrichmentTags, judgment); judgmentEnrichmentService.enrich(judgment, judgmentEnrichmentTags); } return searchResult; } }
JudgmentEnrichmentDbSearchService { public SearchResult<Judgment> search(JudgmentSearchFilter searchFilter) { Preconditions.checkNotNull(searchFilter); SearchResult<Judgment> searchResult = databaseSearchService.search(searchFilter); if (searchFilter.isWithGenerated() != null && !searchFilter.isWithGenerated()) { return searchResult; } if (CollectionUtils.isEmpty(searchResult.getResultRecords())) { return searchResult; } List<Judgment> judgments = searchResult.getResultRecords(); List<EnrichmentTag> enrichmentTags = enrichmentTagRepository.findAllByJudgmentIds(extractJudgmentIds(judgments)); for (Judgment judgment : judgments) { List<EnrichmentTag> judgmentEnrichmentTags = extractEnrichmentTags(enrichmentTags, judgment); judgmentEnrichmentService.enrich(judgment, judgmentEnrichmentTags); } return searchResult; }  }
JudgmentEnrichmentDbSearchService { public SearchResult<Judgment> search(JudgmentSearchFilter searchFilter) { Preconditions.checkNotNull(searchFilter); SearchResult<Judgment> searchResult = databaseSearchService.search(searchFilter); if (searchFilter.isWithGenerated() != null && !searchFilter.isWithGenerated()) { return searchResult; } if (CollectionUtils.isEmpty(searchResult.getResultRecords())) { return searchResult; } List<Judgment> judgments = searchResult.getResultRecords(); List<EnrichmentTag> enrichmentTags = enrichmentTagRepository.findAllByJudgmentIds(extractJudgmentIds(judgments)); for (Judgment judgment : judgments) { List<EnrichmentTag> judgmentEnrichmentTags = extractEnrichmentTags(enrichmentTags, judgment); judgmentEnrichmentService.enrich(judgment, judgmentEnrichmentTags); } return searchResult; }  SearchResult<Judgment> search(JudgmentSearchFilter searchFilter); @Autowired void setDatabaseSearchService(DatabaseSearchService databaseSearchService); @Autowired void setEnrichmentTagRepository(EnrichmentTagRepository enrichmentTagRepository); @Autowired void setJudgmentEnrichmentService(JudgmentEnrichmentService judgmentEnrichmentService); }
JudgmentEnrichmentDbSearchService { public SearchResult<Judgment> search(JudgmentSearchFilter searchFilter) { Preconditions.checkNotNull(searchFilter); SearchResult<Judgment> searchResult = databaseSearchService.search(searchFilter); if (searchFilter.isWithGenerated() != null && !searchFilter.isWithGenerated()) { return searchResult; } if (CollectionUtils.isEmpty(searchResult.getResultRecords())) { return searchResult; } List<Judgment> judgments = searchResult.getResultRecords(); List<EnrichmentTag> enrichmentTags = enrichmentTagRepository.findAllByJudgmentIds(extractJudgmentIds(judgments)); for (Judgment judgment : judgments) { List<EnrichmentTag> judgmentEnrichmentTags = extractEnrichmentTags(enrichmentTags, judgment); judgmentEnrichmentService.enrich(judgment, judgmentEnrichmentTags); } return searchResult; }  SearchResult<Judgment> search(JudgmentSearchFilter searchFilter); @Autowired void setDatabaseSearchService(DatabaseSearchService databaseSearchService); @Autowired void setEnrichmentTagRepository(EnrichmentTagRepository enrichmentTagRepository); @Autowired void setJudgmentEnrichmentService(JudgmentEnrichmentService judgmentEnrichmentService);  }