in component-test/src/main/java/org/apache/fineract/cn/customer/TestIdentificationCards.java [44:63]
public void shouldFetchIdentificationCards() throws Exception {
final String customerIdentifier = this.createCustomer();
Stream.of(
IdentificationCardGenerator.createRandomIdentificationCard(),
IdentificationCardGenerator.createRandomIdentificationCard(),
IdentificationCardGenerator.createRandomIdentificationCard()
).forEach(identificationCard -> {
this.customerManager.createIdentificationCard(customerIdentifier, identificationCard);
try {
this.eventRecorder.wait(CustomerEventConstants.POST_IDENTIFICATION_CARD, identificationCard.getNumber());
} catch (final InterruptedException ex) {
Assert.fail(ex.getMessage());
}
});
final List<IdentificationCard> result = this.customerManager.fetchIdentificationCards(customerIdentifier);
Assert.assertTrue(result.size() == 3);
}