use of org.killbill.billing.invoice.dao.InvoiceTrackingSqlDao in project killbill by killbill.
the class InvoiceChecker method checkTrackingIds.
public void checkTrackingIds(final Invoice invoice, final Set<String> expectedTrackingIds, final InternalCallContext internalCallContext) {
final InvoiceTrackingSqlDao dao = dbi.onDemand(InvoiceTrackingSqlDao.class);
final List<InvoiceTrackingModelDao> result = dao.getTrackingsForInvoices(ImmutableList.of(invoice.getId().toString()), internalCallContext);
final Set<String> existingTrackingIds = ImmutableSet.copyOf(Iterables.transform(result, new Function<InvoiceTrackingModelDao, String>() {
@Override
public String apply(final InvoiceTrackingModelDao input) {
return input.getTrackingId();
}
}));
assertEquals(existingTrackingIds.size(), expectedTrackingIds.size());
for (final String cur : existingTrackingIds) {
assertTrue(expectedTrackingIds.contains(cur));
}
}
Aggregations