@Test(expected = IllegalArgumentException.class) public void findJudgmentIds_NEGATIVE_PAGE_NO() { sourceCcjExternalRepository.findJudgmentIds(-1, 10, null); }
public List<String> findJudgmentIds(int pageNo, int pageSize, DateTime publicationDateFrom) { Preconditions.checkArgument(pageNo >= 0, "pageNo must be greater or equal to zero"); Preconditions.checkArgument(pageSize >= 1 && pageSize <= 5000, "pageSize must be between 1 and 5000"); String url = sourceCcJudgmentUrlFactory.createSourceJudgmentsUrl(pageNo, pageSize, publicationDateFrom); HttpHeaders headers = createHttpHeaders(MediaType.TEXT_XML); ResponseEntity<String> response = restTemplate.exchange(url, HttpMethod.GET, new HttpEntity<String>(headers), String.class); validateJudgmentIdsResponse(response); return xmlTagContentExtractor.extractTagContents(response.getBody(), "id"); }
SourceCcjExternalRepository { public List<String> findJudgmentIds(int pageNo, int pageSize, DateTime publicationDateFrom) { Preconditions.checkArgument(pageNo >= 0, "pageNo must be greater or equal to zero"); Preconditions.checkArgument(pageSize >= 1 && pageSize <= 5000, "pageSize must be between 1 and 5000"); String url = sourceCcJudgmentUrlFactory.createSourceJudgmentsUrl(pageNo, pageSize, publicationDateFrom); HttpHeaders headers = createHttpHeaders(MediaType.TEXT_XML); ResponseEntity<String> response = restTemplate.exchange(url, HttpMethod.GET, new HttpEntity<String>(headers), String.class); validateJudgmentIdsResponse(response); return xmlTagContentExtractor.extractTagContents(response.getBody(), "id"); } }
SourceCcjExternalRepository { public List<String> findJudgmentIds(int pageNo, int pageSize, DateTime publicationDateFrom) { Preconditions.checkArgument(pageNo >= 0, "pageNo must be greater or equal to zero"); Preconditions.checkArgument(pageSize >= 1 && pageSize <= 5000, "pageSize must be between 1 and 5000"); String url = sourceCcJudgmentUrlFactory.createSourceJudgmentsUrl(pageNo, pageSize, publicationDateFrom); HttpHeaders headers = createHttpHeaders(MediaType.TEXT_XML); ResponseEntity<String> response = restTemplate.exchange(url, HttpMethod.GET, new HttpEntity<String>(headers), String.class); validateJudgmentIdsResponse(response); return xmlTagContentExtractor.extractTagContents(response.getBody(), "id"); }  }
SourceCcjExternalRepository { public List<String> findJudgmentIds(int pageNo, int pageSize, DateTime publicationDateFrom) { Preconditions.checkArgument(pageNo >= 0, "pageNo must be greater or equal to zero"); Preconditions.checkArgument(pageSize >= 1 && pageSize <= 5000, "pageSize must be between 1 and 5000"); String url = sourceCcJudgmentUrlFactory.createSourceJudgmentsUrl(pageNo, pageSize, publicationDateFrom); HttpHeaders headers = createHttpHeaders(MediaType.TEXT_XML); ResponseEntity<String> response = restTemplate.exchange(url, HttpMethod.GET, new HttpEntity<String>(headers), String.class); validateJudgmentIdsResponse(response); return xmlTagContentExtractor.extractTagContents(response.getBody(), "id"); }  List<String> findJudgmentIds(int pageNo, int pageSize, DateTime publicationDateFrom); SourceCcJudgmentTextData findJudgment(String judgmentId); @Autowired void setXmlTagContentExtractor(XmlTagContentExtractor xmlTagContentExtractor); @Autowired void setRestTemplate(RestTemplate restTemplate); @Autowired void setSourceCcJudgmentUrlFactory(SourceCcJudgmentUrlFactory sourceCcJudgmentUrlFactory); }
SourceCcjExternalRepository { public List<String> findJudgmentIds(int pageNo, int pageSize, DateTime publicationDateFrom) { Preconditions.checkArgument(pageNo >= 0, "pageNo must be greater or equal to zero"); Preconditions.checkArgument(pageSize >= 1 && pageSize <= 5000, "pageSize must be between 1 and 5000"); String url = sourceCcJudgmentUrlFactory.createSourceJudgmentsUrl(pageNo, pageSize, publicationDateFrom); HttpHeaders headers = createHttpHeaders(MediaType.TEXT_XML); ResponseEntity<String> response = restTemplate.exchange(url, HttpMethod.GET, new HttpEntity<String>(headers), String.class); validateJudgmentIdsResponse(response); return xmlTagContentExtractor.extractTagContents(response.getBody(), "id"); }  List<String> findJudgmentIds(int pageNo, int pageSize, DateTime publicationDateFrom); SourceCcJudgmentTextData findJudgment(String judgmentId); @Autowired void setXmlTagContentExtractor(XmlTagContentExtractor xmlTagContentExtractor); @Autowired void setRestTemplate(RestTemplate restTemplate); @Autowired void setSourceCcJudgmentUrlFactory(SourceCcJudgmentUrlFactory sourceCcJudgmentUrlFactory);  }