profiles: Add test assertions to verify that we correctly return tracking ids for invoices. See
@@ -145,6 +145,8 @@ public class TestUsage extends TestJaxrsBase {
final Invoices invoices = accountApi.getInvoicesForAccount(accountJson.getAccountId(), null, true, false, false, false, AuditLevel.MINIMAL, requestOptions);
Assert.assertEquals(invoices.size(), 2);
+ // Verify system assigned one tracking ID and this is correctly returned
+ Assert.assertEquals(invoices.get(1).getTrackingIds().size(), 1);
final InvoiceItem usageItem = Iterables.tryFind(invoices.get(1).getItems(), new Predicate<InvoiceItem>() {
@Override
@@ -204,7 +206,9 @@ public class TestUsage extends TestJaxrsBase {
final SubscriptionUsageRecord usage = new SubscriptionUsageRecord();
usage.setSubscriptionId(addOnSubscriptionId);
- usage.setTrackingId(UUID.randomUUID().toString());
+
+ final String trackingId = UUID.randomUUID().toString();
+ usage.setTrackingId(trackingId);
usage.setUnitUsageRecords(ImmutableList.<UnitUsageRecord>of(unitUsageRecord));
usageApi.recordUsage(usage, requestOptions);
