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());
}
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);
}
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());
}
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);
}
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());
}
Aggregations