assertEquals(updatedRecipient.getDescription(), "Updated Description");
}
@Test
public void testRecipientCardAddition() throws StripeException {
Recipient createdRecipient = Recipient.create(defaultRecipientParams);
String originalDefaultCard = createdRecipient.getDefaultCard();
Map<String, Object> creationParams = new HashMap<String, Object>();
creationParams.put("card", defaultDebitCardParams);
Card addedCard = createdRecipient.createCard(creationParams);
Token token = Token.create(defaultDebitTokenParams);
createdRecipient.createCard(token.getId());
Recipient updatedRecipient = Recipient.retrieve(createdRecipient.getId());
assertEquals((Integer) 3, (Integer) updatedRecipient.getCards().getData().size());
assertEquals(updatedRecipient.getDefaultCard(), originalDefaultCard);
Map<String, Object> updateParams = new HashMap<String, Object>();
updateParams.put("default_card", addedCard.getId());
Recipient recipientAfterDefaultCardUpdate = updatedRecipient.update(updateParams);
assertEquals((Integer) recipientAfterDefaultCardUpdate.getCards().getData().size(), (Integer) 3);
assertEquals(recipientAfterDefaultCardUpdate.getDefaultCard(), addedCard.getId());
assertEquals(recipientAfterDefaultCardUpdate.getCards().retrieve(originalDefaultCard).getId(), originalDefaultCard);
assertEquals(recipientAfterDefaultCardUpdate.getCards().retrieve(addedCard.getId()).getId(), addedCard.getId());
}