EntitlementCertificate cert = createEntitlementCertificate("fake", "fake");
Entitlement entitlement = createEntitlement(owner, consumer, pool1, cert);
entitlement.setQuantity(1);
entitlementCurator.create(entitlement);
OwnerInfo info = ownerInfoCurator.lookupByOwner(owner);
Map<String, Integer> expectedConsumers = new HashMap<String, Integer>() {
{
put("system", 1);
put("domain", 0);
put("uebercert", 0);
}
};
Map<String, Integer> expectedEntitlementsConsumed = new HashMap<String, Integer>() {
{
put("system", 1);
put("domain", 0);
put("uebercert", 0);
}
};
assertEquals(expectedConsumers, info.getConsumerCounts());
assertEquals(expectedEntitlementsConsumed, info.getEntitlementsConsumedByType());
}