use of org.candlepin.auth.TrustedUserPrincipal in project candlepin by candlepin.
the class ConsumerResourceCreationTest method oauthRegistrationSupported.
@Test
public void oauthRegistrationSupported() {
// Should be able to register successfully with as a trusted user principal:
Principal p = new TrustedUserPrincipal("anyuser");
ConsumerDTO consumer = TestUtil.createConsumerDTO("sys.example.com", null, null, systemDto);
resource.create(consumer, p, null, owner.getKey(), null, true);
}
use of org.candlepin.auth.TrustedUserPrincipal in project candlepin by candlepin.
the class ConsumerResourceCreationTest method registerWithNoReleaseVer.
@Test
public void registerWithNoReleaseVer() {
Principal p = new TrustedUserPrincipal("anyuser");
ConsumerDTO consumer = TestUtil.createConsumerDTO("consumername", null, null, systemDto);
resource.create(consumer, p, USER, owner.getKey(), null, true);
}
use of org.candlepin.auth.TrustedUserPrincipal in project candlepin by candlepin.
the class ConsumerResourceCreationTest method registerWithNoInstalledProducts.
@Test
public void registerWithNoInstalledProducts() {
Principal p = new TrustedUserPrincipal("anyuser");
ConsumerDTO consumer = TestUtil.createConsumerDTO("consumerName", null, null, systemDto);
resource.create(consumer, p, USER, owner.getKey(), null, true);
}
use of org.candlepin.auth.TrustedUserPrincipal in project candlepin by candlepin.
the class ConsumerResourceCreationTest method setStatusOnCreate.
@Test
public void setStatusOnCreate() {
Principal p = new TrustedUserPrincipal("anyuser");
ConsumerDTO consumer = TestUtil.createConsumerDTO("consumername", null, null, systemDto);
resource.create(consumer, p, USER, owner.getKey(), null, true);
// Should be called with the consumer, null date (now),
// no compliantUntil, and not update the consumer record
verify(complianceRules).getStatus(any(Consumer.class), eq((Date) null), eq(false), eq(false));
}
use of org.candlepin.auth.TrustedUserPrincipal in project candlepin by candlepin.
the class ConsumerResourceCreationTest method registerWithEmptyReleaseVer.
@Test
public void registerWithEmptyReleaseVer() {
Principal p = new TrustedUserPrincipal("anyuser");
ConsumerDTO consumer = TestUtil.createConsumerDTO("consumername", null, null, systemDto);
consumer.setReleaseVersion("");
resource.create(consumer, p, USER, owner.getKey(), null, true);
}
Aggregations