use of org.candlepin.model.activationkeys.ActivationKeyContentOverride in project candlepin by candlepin.
the class ActivationKeyContentOverrideCuratorTest method testCreateOverrideForcesLowercaseName.
@Test
public void testCreateOverrideForcesLowercaseName() {
ActivationKeyContentOverride override = new ActivationKeyContentOverride(key, "test-repo", "GpGCheck", "1");
ActivationKeyContentOverride created = this.activationKeyContentOverrideCurator.create(override);
assertEquals("gpgcheck", created.getName());
}
use of org.candlepin.model.activationkeys.ActivationKeyContentOverride in project candlepin by candlepin.
the class ActivationKeyContentOverrideCuratorTest method testRemoveByConsumer.
@Test
public void testRemoveByConsumer() {
ActivationKey key2 = new ActivationKey("other key", owner);
key2 = activationKeyCurator.create(key2);
activationKeyContentOverrideCurator.create(new ActivationKeyContentOverride(key2, "test-repo", "gpgcheck", "1"));
activationKeyContentOverrideCurator.create(new ActivationKeyContentOverride(key, "test-repo", "gpgcheck", "1"));
activationKeyContentOverrideCurator.create(new ActivationKeyContentOverride(key, "another-test-repo", "gpgcheck", "0"));
activationKeyContentOverrideCurator.removeByParent(key);
assertTrue(activationKeyContentOverrideCurator.getList(key).isEmpty());
assertEquals(1, activationKeyContentOverrideCurator.getList(key2).size());
}
use of org.candlepin.model.activationkeys.ActivationKeyContentOverride in project candlepin by candlepin.
the class ActivationKeyContentOverrideCuratorTest method normalCreateAndRetrieve.
@Test
public void normalCreateAndRetrieve() {
ActivationKeyContentOverride cco = new ActivationKeyContentOverride(key, "test-content", "name", "value");
activationKeyContentOverrideCurator.create(cco);
ActivationKeyContentOverride cco2 = activationKeyContentOverrideCurator.retrieve(key, "test-content", "name");
assert (cco2 != null);
assertEquals("value", cco2.getValue());
}
use of org.candlepin.model.activationkeys.ActivationKeyContentOverride in project candlepin by candlepin.
the class ActivationKeyContentOverrideCuratorTest method deleteByName.
@Test
public void deleteByName() {
ActivationKeyContentOverride cco = new ActivationKeyContentOverride(key, "test-content", "name", "value");
activationKeyContentOverrideCurator.create(cco);
activationKeyContentOverrideCurator.removeByName(key, "test-content", "name");
ActivationKeyContentOverride cco2 = activationKeyContentOverrideCurator.retrieve(key, "test-content", "name");
assert (cco2 == null);
}
use of org.candlepin.model.activationkeys.ActivationKeyContentOverride in project candlepin by candlepin.
the class ActivationKeyContentOverrideCuratorTest method testAddOrUpdateCreatesNew.
@Test
public void testAddOrUpdateCreatesNew() {
ActivationKeyContentOverride cco1 = new ActivationKeyContentOverride(key, "test-content1", "name1", "value");
activationKeyContentOverrideCurator.create(cco1);
ActivationKeyContentOverride cco2 = new ActivationKeyContentOverride(key, "test-content2", "name2", "value2");
activationKeyContentOverrideCurator.addOrUpdate(key, cco2);
List<ActivationKeyContentOverride> ccoList = activationKeyContentOverrideCurator.listAll().list();
assertEquals(2, ccoList.size());
}
Aggregations