Search in sources :

Example 6 with ContentOverride

use of org.candlepin.model.ContentOverride in project candlepin by candlepin.

the class ActivationKeyContentOverrideResourceTest method testActivationKeyDeleteOverride.

@Test
public void testActivationKeyDeleteOverride() {
    ActivationKeyContentOverride override = new ActivationKeyContentOverride(key, "label", "name", "test");
    List<ContentOverride> toDelete = new LinkedList<>();
    toDelete.add(override);
    akcor.deleteContentOverrides(context, principal, toDelete);
    verify(activationKeyContentOverrideCurator, Mockito.times(1)).removeByName(eq(key), eq(override.getContentLabel()), eq(override.getName()));
}
Also used : ContentOverride(org.candlepin.model.ContentOverride) ActivationKeyContentOverride(org.candlepin.model.activationkeys.ActivationKeyContentOverride) LinkedList(java.util.LinkedList) ActivationKeyContentOverride(org.candlepin.model.activationkeys.ActivationKeyContentOverride) Test(org.junit.Test)

Example 7 with ContentOverride

use of org.candlepin.model.ContentOverride in project candlepin by candlepin.

the class ContentOverrideValidatorTest method testValidateValidCollection.

@Test
public void testValidateValidCollection() {
    List<ContentOverride> overrides = new LinkedList<>();
    overrides.add(new ContentOverride("label", "testname", "value"));
    overrides.add(new ContentOverride("other label", "other name", "other value"));
    validator.validate(overrides);
}
Also used : ContentOverride(org.candlepin.model.ContentOverride) LinkedList(java.util.LinkedList) Test(org.junit.Test)

Example 8 with ContentOverride

use of org.candlepin.model.ContentOverride in project candlepin by candlepin.

the class ConsumerContentOverrideResourceTest method testAddOverride.

@Test
public void testAddOverride() {
    List<ContentOverride> entries = new LinkedList<>();
    ConsumerContentOverride toAdd = new ConsumerContentOverride(consumer, "label", "overridename", "overridevalue");
    entries.add(toAdd);
    resource.addContentOverrides(context, principal, entries);
    Mockito.verify(consumerContentOverrideCurator, Mockito.times(1)).addOrUpdate(consumer, toAdd);
}
Also used : ConsumerContentOverride(org.candlepin.model.ConsumerContentOverride) ContentOverride(org.candlepin.model.ContentOverride) ConsumerContentOverride(org.candlepin.model.ConsumerContentOverride) LinkedList(java.util.LinkedList) Test(org.junit.Test)

Aggregations

ContentOverride (org.candlepin.model.ContentOverride)8 LinkedList (java.util.LinkedList)6 Test (org.junit.Test)6 ActivationKeyContentOverride (org.candlepin.model.activationkeys.ActivationKeyContentOverride)3 Transactional (com.google.inject.persist.Transactional)2 Consumes (javax.ws.rs.Consumes)2 Produces (javax.ws.rs.Produces)2 SecurityHole (org.candlepin.common.auth.SecurityHole)2 DELETE (javax.ws.rs.DELETE)1 PUT (javax.ws.rs.PUT)1 BadRequestException (org.candlepin.common.exceptions.BadRequestException)1 ConsumerContentOverride (org.candlepin.model.ConsumerContentOverride)1