assertEquals(range2.getEndDate(), validRange.getEndDate());
}
@Test
public void validRangeWhenGuestLimitOverridden() {
Consumer c = mockConsumer(PRODUCT_1);
for (int i = 0; i < 5; i++) {
c.addGuestId(new GuestId("" + i, c, getActiveGuestAttrs()));
}
Calendar cal = Calendar.getInstance();
Date now = cal.getTime();
DateRange range = rangeRelativeToDate(now, -4, 4);
DateRange hypervisorRange = rangeRelativeToDate(now, -2, 2);
Entitlement ent = mockStackedEntitlement(c, range, STACK_ID_1, PRODUCT_1, 10, PRODUCT_1);
ent.getPool().setProductAttribute("guest_limit", "2", PRODUCT_1);
c.addEntitlement(ent);
Entitlement hpvsrEnt = mockStackedEntitlement(c, hypervisorRange,
"other_stack_id", "other", 10, "prod2");
hpvsrEnt.getPool().setProductAttribute("guest_limit", "-1", "prod2");
c.addEntitlement(hpvsrEnt);
List<Entitlement> ents = new LinkedList<Entitlement>(c.getEntitlements());
mockEntCurator(c, ents);
ComplianceStatus status = compliance.getStatus(c, now);
assertEquals("valid", status.getStatus());
ConsumerInstalledProductEnricher calculator =