use of org.candlepin.dto.manifest.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);
}
use of org.candlepin.dto.manifest.v1.ConsumerDTO in project candlepin by candlepin.
the class ConsumerResourceCreationTest method registerWithNullReleaseVer.
@Test
public void registerWithNullReleaseVer() {
Principal p = new TrustedUserPrincipal("anyuser");
ConsumerDTO consumer = TestUtil.createConsumerDTO("consumername", null, null, systemDto);
consumer.setReleaseVersion(null);
resource.create(consumer, p, USER, owner.getKey(), null, true);
}
use of org.candlepin.dto.manifest.v1.ConsumerDTO in project candlepin by candlepin.
the class ConsumerResourceCreationTest method cannotMixUsernameWithActivationKeys.
@Test(expected = BadRequestException.class)
public void cannotMixUsernameWithActivationKeys() {
Principal p = new NoAuthPrincipal();
List<String> keys = mockActivationKeys();
ConsumerDTO consumer = TestUtil.createConsumerDTO("sys.example.com", null, null, systemDto);
resource.create(consumer, p, USER, owner.getKey(), createKeysString(keys), true);
}
use of org.candlepin.dto.manifest.v1.ConsumerDTO in project candlepin by candlepin.
the class ConsumerResourceCreationTest method passIfOnlyOneActivationKeyDoesNotExistForOrg.
@Test
public void passIfOnlyOneActivationKeyDoesNotExistForOrg() {
Principal p = new NoAuthPrincipal();
List<String> keys = mockActivationKeys();
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.manifest.v1.ConsumerDTO in project candlepin by candlepin.
the class ConsumerResourceIntegrationTest method personalNameOverride.
@Test
public void personalNameOverride() {
ConsumerDTO personal = createConsumerDTO(personTypeDTO, ownerDTO);
personal = consumerResource.create(personal, principal, null, null, null, true);
// Not sure if this should be hard-coded to default
assertEquals(USER_NAME, personal.getName());
}
Aggregations