assertNotNull(validRange);
}
@Test
public void validRangeEndDateSetToFirstDateOfLosingValidStatus() {
Consumer c = mockConsumer(PRODUCT_1);
Calendar cal = Calendar.getInstance();
Date now = cal.getTime();
DateRange range1 = rangeRelativeToDate(now, -4, 4);
DateRange range2 = rangeRelativeToDate(now, -2, 10);
DateRange range3 = rangeRelativeToDate(now, -3, -1);
DateRange range4 = rangeRelativeToDate(range1.getEndDate(), 0, 10);
c.addEntitlement(mockStackedEntitlement(c, range4, STACK_ID_1, PRODUCT_1, 1,
PRODUCT_1));
c.addEntitlement(mockStackedEntitlement(c, range1, STACK_ID_1, PRODUCT_1, 1,
PRODUCT_1));
c.addEntitlement(mockStackedEntitlement(c, range2, STACK_ID_1, PRODUCT_1, 1,
PRODUCT_1));
c.addEntitlement(mockStackedEntitlement(c, range3, STACK_ID_1, PRODUCT_1, 1,
PRODUCT_1));
List<Entitlement> ents = new LinkedList<Entitlement>(c.getEntitlements());
mockEntCurator(c, ents);
ComplianceStatus status = compliance.getStatus(c, now);
ConsumerInstalledProductEnricher calculator =
new ConsumerInstalledProductEnricher(c, status, compliance);