private void WebServiceBuildsCriteriaWithPolicyNumber(ClaimSearch cs) { queryParams.with(ClaimsWebService.POLICY_ID, "12345"); Capture<ClaimSearchCriteria> captured = new Capture<ClaimSearchCriteria>(); cs.findClaims(GROUPS, emptyClaims(), captured); ClaimSearchCriteria criteria = captured.getValue(); assertThat(criteria.getPolicyId(), is(12345L)); }
private void WebServiceBuildsCriteriaWithClaimantName(ClaimSearch cs) { queryParams.with("claimantName", "Name"); Capture<ClaimSearchCriteria> captured = new Capture<ClaimSearchCriteria>(); cs.findClaims(GROUPS, emptyClaims(), captured); ClaimSearchCriteria criteria = captured.getValue(); assertThat(criteria.getClaimantName(), is(equalTo("Name"))); }
// -------------------------------- // Criteria Construction Tests // -------------------------------- private void WebServiceBuildsCriteriaWithClaimNumber(ClaimSearch cs) { String claimNumber = "claimnumber"; queryParams.with("number", claimNumber); Capture<ClaimSearchCriteria> captured = new Capture<ClaimSearchCriteria>(); cs.findClaims(GROUPS, emptyClaims(), captured); assertThat(captured.getValue().getNumber(), is(equalTo(claimNumber))); }
@Test public void WebServiceBuildsCriteriaWithPolicyBeginDateRange() { Capture<ClaimSearchCriteria> captured = new Capture<ClaimSearchCriteria>(); queryParams.with("policyDateStart", "01012004").with("policyDateEnd", "01012006"); new SlClaimSearch().findClaims(GROUPS, emptyClaims(), captured); ClaimSearchCriteria criteria = captured.getValue(); assertThat(criteria.getPolicyBeginDate(), is(createDate("2004/01/01"))); assertThat(criteria.getPolicyEndDate(), is(createDate("2006/01/01"))); }
@Test(expected = WebApplicationException.class) public void ToIncurredDateWithNoFromDateFails() { queryParams.with(ClaimsWebService.INCURRED_DATE_TO, "01012004"); new WcClaimSearch().findClaims(GROUPS, emptyClaims(), new Capture<ClaimSearchCriteria>()); }
@Test(expected = WebApplicationException.class) public void PolicyDateEndWithNoStartFails() { queryParams.with(ClaimsWebService.POLICY_DATE_END, "01012004"); new SlClaimSearch().findClaims(GROUPS, emptyClaims(), null); }