@Test public void shouldList() throws Exception { String responseAsString = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" standalone=\"yes\"?>" + "<installments>" + "<installment>" + "<cardBrand>visa</cardBrand>" + "<quantity>1</quantity>" + "<amount>100.00</amount>" + "<totalAmount>100.00</totalAmount>" + "<interestFree>true</interestFree>" + "</installment>" + "<installment>" + "<cardBrand>visa</cardBrand>" + "<quantity>2</quantity>" + "<amount>50.00</amount>" + "<totalAmount>100.00</totalAmount>" + "<interestFree>true</interestFree>" + "</installment>" + "<installment>" + "<cardBrand>visa</cardBrand>" + "<quantity>3</quantity>" + "<amount>34.33</amount>" + "<totalAmount>102.99</totalAmount>" + "<interestFree>false</interestFree>" + "</installment>" + "</installments>"; HttpResponse response = new HttpResponse(200, responseAsString); when(httpClient.execute(any(HttpMethod.class), anyString(), anyMap(), any(HttpRequestBody.class))).thenReturn(response); DataList<? extends InstallmentDetail> data = installmentsListResource.list(installmentRequest); Iterator<InstallmentDetail> iterator = (Iterator<InstallmentDetail>) data.iterator(); InstallmentDetail installment = iterator.next(); assertEquals("visa", installment.getCardBrand()); assertEquals(new Integer(1), installment.getQuantity()); assertEquals(new BigDecimal(100.00).setScale(2), installment.getAmount()); assertEquals(new BigDecimal(100.00).setScale(2), installment.getTotalAmount()); assertEquals(true, installment.getInterestFree()); installment = iterator.next(); assertEquals("visa", installment.getCardBrand()); assertEquals(new Integer(2), installment.getQuantity()); assertEquals(new BigDecimal(50.00).setScale(2), installment.getAmount()); assertEquals(new BigDecimal(100.00).setScale(2), installment.getTotalAmount()); assertEquals(true, installment.getInterestFree()); installment = iterator.next(); assertEquals("visa", installment.getCardBrand()); assertEquals(new Integer(3), installment.getQuantity()); assertEquals(new BigDecimal(34.33).setScale(2, RoundingMode.HALF_EVEN), installment.getAmount()); assertEquals(new BigDecimal(102.99).setScale(2, RoundingMode.HALF_EVEN), installment.getTotalAmount()); assertEquals(false, installment.getInterestFree()); }
public DataList<? extends InstallmentDetail> list( Builder<InstallmentRequest> installmentListingBuilder) { return list(installmentListingBuilder.build()); }
InstallmentsListResource { public DataList<? extends InstallmentDetail> list( Builder<InstallmentRequest> installmentListingBuilder) { return list(installmentListingBuilder.build()); } }
InstallmentsListResource { public DataList<? extends InstallmentDetail> list( Builder<InstallmentRequest> installmentListingBuilder) { return list(installmentListingBuilder.build()); } InstallmentsListResource(PagSeguro pagSeguro, HttpClient httpClient); }
InstallmentsListResource { public DataList<? extends InstallmentDetail> list( Builder<InstallmentRequest> installmentListingBuilder) { return list(installmentListingBuilder.build()); } InstallmentsListResource(PagSeguro pagSeguro, HttpClient httpClient); DataList<? extends InstallmentDetail> list(
      Builder<InstallmentRequest> installmentListingBuilder); DataList<? extends InstallmentDetail> list(InstallmentRequest installmentRequest); }
InstallmentsListResource { public DataList<? extends InstallmentDetail> list( Builder<InstallmentRequest> installmentListingBuilder) { return list(installmentListingBuilder.build()); } InstallmentsListResource(PagSeguro pagSeguro, HttpClient httpClient); DataList<? extends InstallmentDetail> list(
      Builder<InstallmentRequest> installmentListingBuilder); DataList<? extends InstallmentDetail> list(InstallmentRequest installmentRequest);  }