cal.add(Calendar.MONTH, 1);
Date targetDate = cal.getTime();
// Should be filtered out due to different owner.
String filteredUuid = TestUtils.randomString("filtered-consumer-uuid");
consumerStateCurator.create(new ConsumerState(filteredUuid, "TO1", creationDate));
String targetOwnerKey = "TO2";
String includedUuid = TestUtils.randomString("included-consumer-uuid");
consumerStateCurator.create(new ConsumerState(includedUuid, targetOwnerKey, creationDate));
// Should not be returned as it is deleted
String deletedUuid = TestUtils.randomString("deleted-consumer-uuid");
consumerStateCurator.create(new ConsumerState(deletedUuid, targetOwnerKey, creationDate));
consumerStateCurator.setConsumerDeleted(deletedUuid, deletionDate);
List<String> uuids = consumerStateCurator.getConsumerUuidsOnDate(targetDate,
Arrays.asList(targetOwnerKey), null);
assertEquals(1, uuids.size());