use of org.candlepin.auth.permissions.OwnerPermission in project candlepin by candlepin.
the class ConsumerResourceIntegrationTest method testCreateConsumer.
@Test
@SuppressWarnings("checkstyle:indentation")
public void testCreateConsumer() {
ConsumerDTO toSubmit = createConsumerDTO(CONSUMER_NAME, USER_NAME, null, standardSystemTypeDTO);
toSubmit.setFact(METADATA_NAME, METADATA_VALUE);
ConsumerDTO submitted = consumerResource.create(toSubmit, new UserPrincipal(someuser.getUsername(), Arrays.asList(new Permission[] { new OwnerPermission(owner, Access.ALL) }), false), someuser.getUsername(), owner.getKey(), null, true);
assertNotNull(submitted);
assertNotNull(consumerCurator.find(submitted.getId()));
assertEquals(standardSystemType.getLabel(), submitted.getType().getLabel());
assertEquals(METADATA_VALUE, submitted.getFact(METADATA_NAME));
}
Aggregations