* Test verifies that list of certs changes after regeneration
*/
@SuppressWarnings("unchecked")
@Test
public void testRegenerateEntitlementCertificateWithValidConsumerByEntitlement() {
ConsumerResource cr = new ConsumerResource(this.consumerCurator, null,
null, null, this.entitlementCurator, null, null, null, null, null,
null, null, null, null, this.poolManager, null, null, null,
null, null, null, null, null, new CandlepinCommonTestConfig(), null,
null, null, mock(ConsumerBindUtil.class));
Response rsp = consumerResource.bind(
consumer.getUuid(), pool.getId().toString(), null, 1, null,
null, false, null, null);
List<Entitlement> resultList = (List<Entitlement>) rsp.getEntity();
Entitlement ent = resultList.get(0);
Set<EntitlementCertificate> entCertsBefore = ent.getCertificates();
cr.regenerateEntitlementCertificates(this.consumer.getUuid(),
ent.getId(), true);
Set<EntitlementCertificate> entCertsAfter = ent.getCertificates();
assertFalse(entCertsBefore.equals(entCertsAfter));
}