use of org.candlepin.model.ConsumerContentOverrideCurator in project candlepin by candlepin.
the class ConsumerResourceTest method testCreatePersonConsumerWithActivationKey.
@Test(expected = BadRequestException.class)
public void testCreatePersonConsumerWithActivationKey() {
ConsumerType ctype = this.mockConsumerType(new ConsumerType(ConsumerTypeEnum.PERSON));
ConsumerTypeDTO ctypeDto = this.translator.translate(ctype, ConsumerTypeDTO.class);
Owner owner = this.createOwner();
Consumer consumer = this.createConsumer(owner, ctype);
ConsumerDTO consumerDto = this.translator.translate(consumer, ConsumerDTO.class);
ActivationKey ak = mock(ActivationKey.class);
NoAuthPrincipal nap = mock(NoAuthPrincipal.class);
ActivationKeyCurator akc = mock(ActivationKeyCurator.class);
ConsumerContentOverrideCurator ccoc = mock(ConsumerContentOverrideCurator.class);
when(ak.getId()).thenReturn("testKey");
when(akc.lookupForOwner(eq(owner.getKey()), eq(owner))).thenReturn(ak);
ConsumerResource cr = new ConsumerResource(null, mockConsumerTypeCurator, null, null, null, null, null, null, i18n, null, null, null, null, null, null, null, mockOwnerCurator, akc, null, null, null, null, null, this.config, null, null, null, consumerBindUtil, null, null, this.factValidator, null, consumerEnricher, migrationProvider, translator);
cr.create(consumerDto, nap, null, owner.getKey(), "testKey", true);
}
Aggregations