use of org.candlepin.auth.ConsumerPrincipal in project candlepin by candlepin.
the class ConsumerResourceIntegrationTest method consumerCanDeleteSelf.
@Test
public void consumerCanDeleteSelf() throws GeneralSecurityException, IOException {
Consumer toSubmit = new Consumer(CONSUMER_NAME, USER_NAME, owner, standardSystemType);
toSubmit.getFacts().put(METADATA_NAME, METADATA_VALUE);
Consumer c = consumerCurator.create(toSubmit);
IdentityCertificate idCert = icsa.generateIdentityCert(c);
c.setIdCert(idCert);
setupPrincipal(new ConsumerPrincipal(c, owner));
consumerResource.deleteConsumer(c.getUuid(), principal);
}
use of org.candlepin.auth.ConsumerPrincipal in project candlepin by candlepin.
the class ConsumerResourceIntegrationTest method consumerShouldSeeOwnEntitlements.
@Test
public void consumerShouldSeeOwnEntitlements() {
consumerResource.bind(consumer.getUuid(), pool.getId().toString(), null, 1, null, null, false, null, null);
consumerResource.bind(consumer.getUuid(), pool.getId().toString(), null, 1, null, null, false, null, null);
consumerResource.bind(consumer.getUuid(), pool.getId().toString(), null, 1, null, null, false, null, null);
setupPrincipal(new ConsumerPrincipal(consumer, owner));
securityInterceptor.enable();
assertEquals(3, consumerResource.listEntitlements(consumer.getUuid(), null, true, "", new ArrayList<>(), null).size());
}
Aggregations