Search in sources :

Example 16 with ActivationKeyContentOverride

use of org.candlepin.model.activationkeys.ActivationKeyContentOverride in project candlepin by candlepin.

the class ActivationKeyContentOverrideCuratorTest method testRemoveByContentLabel.

@Test
public void testRemoveByContentLabel() {
    activationKeyContentOverrideCurator.create(new ActivationKeyContentOverride(key, "test-repo", "gpgcheck", "1"));
    activationKeyContentOverrideCurator.create(new ActivationKeyContentOverride(key, "test-repo", "foo", "foo-v"));
    activationKeyContentOverrideCurator.create(new ActivationKeyContentOverride(key, "should-remain", "remaining", "true"));
    activationKeyContentOverrideCurator.removeByContentLabel(key, "test-repo");
    List<ActivationKeyContentOverride> remaining = activationKeyContentOverrideCurator.getList(key);
    assertEquals(1, remaining.size());
    assertEquals("should-remain", remaining.get(0).getContentLabel());
    assertEquals("remaining", remaining.get(0).getName());
}
Also used : ActivationKeyContentOverride(org.candlepin.model.activationkeys.ActivationKeyContentOverride) Test(org.junit.Test)

Example 17 with ActivationKeyContentOverride

use of org.candlepin.model.activationkeys.ActivationKeyContentOverride in project candlepin by candlepin.

the class ActivationKeyContentOverrideCuratorTest method deleteByLabel.

@Test
public void deleteByLabel() {
    ActivationKeyContentOverride cco1 = new ActivationKeyContentOverride(key, "test-content", "name1", "value");
    activationKeyContentOverrideCurator.create(cco1);
    ActivationKeyContentOverride cco2 = new ActivationKeyContentOverride(key, "test-content", "name2", "value");
    activationKeyContentOverrideCurator.create(cco2);
    activationKeyContentOverrideCurator.removeByContentLabel(key, "test-content");
    List<ActivationKeyContentOverride> ccoList = activationKeyContentOverrideCurator.listAll().list();
    assertEquals(ccoList.size(), 0);
}
Also used : ActivationKeyContentOverride(org.candlepin.model.activationkeys.ActivationKeyContentOverride) Test(org.junit.Test)

Example 18 with ActivationKeyContentOverride

use of org.candlepin.model.activationkeys.ActivationKeyContentOverride in project candlepin by candlepin.

the class ActivationKeyContentOverrideCuratorTest method testModifyOverrideForcesNameToLowercase.

@Test
public void testModifyOverrideForcesNameToLowercase() {
    ActivationKeyContentOverride override = new ActivationKeyContentOverride(key, "test-repo", "gpgcheck", "0");
    ActivationKeyContentOverride created = this.activationKeyContentOverrideCurator.create(override);
    created.setName("GPGCHECK");
    ActivationKeyContentOverride merged = this.activationKeyContentOverrideCurator.merge(created);
    assertEquals("gpgcheck", merged.getName());
}
Also used : ActivationKeyContentOverride(org.candlepin.model.activationkeys.ActivationKeyContentOverride) Test(org.junit.Test)

Example 19 with ActivationKeyContentOverride

use of org.candlepin.model.activationkeys.ActivationKeyContentOverride in project candlepin by candlepin.

the class ActivationKeyContentOverrideCuratorTest method testRetrieveByNameDoesntExist.

@Test
public void testRetrieveByNameDoesntExist() {
    ActivationKeyContentOverride found = activationKeyContentOverrideCurator.retrieve(key, "not-a-repo", "gpgcheck");
    assertNull(found);
}
Also used : ActivationKeyContentOverride(org.candlepin.model.activationkeys.ActivationKeyContentOverride) Test(org.junit.Test)

Example 20 with ActivationKeyContentOverride

use of org.candlepin.model.activationkeys.ActivationKeyContentOverride in project candlepin by candlepin.

the class ActivationKeyContentOverrideCuratorTest method testRemoveByName.

@Test
public void testRemoveByName() {
    activationKeyContentOverrideCurator.create(new ActivationKeyContentOverride(key, "test-repo", "gpgcheck", "1"));
    activationKeyContentOverrideCurator.create(new ActivationKeyContentOverride(key, "test-repo", "remaining-override", "remaining"));
    activationKeyContentOverrideCurator.removeByName(key, "test-repo", "gpgcheck");
    List<ActivationKeyContentOverride> remaining = activationKeyContentOverrideCurator.getList(key);
    assertEquals(1, remaining.size());
    assertEquals("remaining-override", remaining.get(0).getName());
}
Also used : ActivationKeyContentOverride(org.candlepin.model.activationkeys.ActivationKeyContentOverride) Test(org.junit.Test)

Aggregations

ActivationKeyContentOverride (org.candlepin.model.activationkeys.ActivationKeyContentOverride)26 Test (org.junit.Test)22 LinkedList (java.util.LinkedList)4 ContentOverride (org.candlepin.model.ContentOverride)3 Product (org.candlepin.model.Product)3 Release (org.candlepin.model.Release)3 ActivationKeyPool (org.candlepin.model.activationkeys.ActivationKeyPool)2 ActivationKeyDTO (org.candlepin.dto.api.v1.ActivationKeyDTO)1 ConsumerContentOverride (org.candlepin.model.ConsumerContentOverride)1 Owner (org.candlepin.model.Owner)1 Pool (org.candlepin.model.Pool)1 ActivationKey (org.candlepin.model.activationkeys.ActivationKey)1