use of org.candlepin.dto.api.v1.ConsumerDTO 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.dto.api.v1.ConsumerDTO 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.dto.api.v1.ConsumerDTO 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.dto.api.v1.ConsumerDTO in project candlepin by candlepin.
the class ConsumerResourceCreationTest method failIfOnlyActivationKeyDoesNotExistForOrg.
@Test(expected = BadRequestException.class)
public void failIfOnlyActivationKeyDoesNotExistForOrg() {
Principal p = new NoAuthPrincipal();
List<String> keys = new ArrayList<>();
keys.add("NoSuchKey");
ConsumerDTO consumer = TestUtil.createConsumerDTO("sys.example.com", null, null, systemDto);
resource.create(consumer, p, null, owner.getKey(), createKeysString(keys), true);
}
use of org.candlepin.dto.api.v1.ConsumerDTO 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