Ejemplo n.º 1
0
  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));
  }
Ejemplo n.º 2
0
  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")));
  }
Ejemplo n.º 3
0
 private void WebServiceReturnsClaimsFromService(List<Claim> claims, ClaimSearch cs) {
   Capture<ClaimSearchCriteria> captured = new Capture<ClaimSearchCriteria>();
   List<JsonClaim> claimsFound = cs.findClaims(GROUPS, claims, captured);
   assertThat(captured.getValue().getGroupNumbers(), is(sameInstance(GROUPS)));
   assertThat(claimsFound, is(not(nullValue())));
   assertThat(claimsFound.size(), is(equalTo(claims.size())));
   assertThat(claimsFound.get(0).getId(), is(claims.get(0).getId()));
 }
Ejemplo n.º 4
0
  // --------------------------------
  // 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)));
  }
Ejemplo n.º 5
0
 // --------------------------------
 // Exception Handling Tests
 // --------------------------------
 private void NoGroupsAreSuppliedFail(ClaimSearch cs) {
   cs.findClaims(null, emptyClaims(), null);
 }