Search in sources :

Example 1 with ConsumerContentOverride

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

the class ConsumerBindUtil method handleActivationKeyOverrides.

private void handleActivationKeyOverrides(Consumer consumer, Set<ActivationKeyContentOverride> overrides) {
    for (ActivationKeyContentOverride akco : overrides) {
        ConsumerContentOverride consumerOverride = akco.buildConsumerContentOverride(consumer);
        this.consumerContentOverrideCurator.addOrUpdate(consumer, consumerOverride);
    }
}
Also used : ConsumerContentOverride(org.candlepin.model.ConsumerContentOverride) ActivationKeyContentOverride(org.candlepin.model.activationkeys.ActivationKeyContentOverride)

Example 2 with ConsumerContentOverride

use of org.candlepin.model.ConsumerContentOverride 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

ConsumerContentOverride (org.candlepin.model.ConsumerContentOverride)2 LinkedList (java.util.LinkedList)1 ContentOverride (org.candlepin.model.ContentOverride)1 ActivationKeyContentOverride (org.candlepin.model.activationkeys.ActivationKeyContentOverride)1 Test (org.junit.Test)1