Package org.candlepin.model.activationkeys

Examples of org.candlepin.model.activationkeys.ActivationKeyContentOverride


        assertEquals("value2", ccoList.get(0).getValue());
    }

    @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();
View Full Code Here


        assertEquals(2, ccoList.size());
    }

    @Test
    public void testCreateOverride() {
        ActivationKeyContentOverride override = new ActivationKeyContentOverride(key,
            "test-repo", "gpgcheck", "1");
        assertEquals(override, this.activationKeyContentOverrideCurator.create(override));
    }
View Full Code Here

        assertEquals(override, this.activationKeyContentOverrideCurator.create(override));
    }

    @Test
    public void testCreateOverrideForcesLowercaseName() {
        ActivationKeyContentOverride override = new ActivationKeyContentOverride(key,
            "test-repo", "GpGCheck", "1");
        ActivationKeyContentOverride created =
            this.activationKeyContentOverrideCurator.create(override);
        assertEquals("gpgcheck", created.getName());
    }
View Full Code Here

        assertEquals("gpgcheck", created.getName());
    }

    @Test
    public void testModifyOverride() {
        ActivationKeyContentOverride override = new ActivationKeyContentOverride(key,
            "test-repo", "GpGCheck", "1");
        ActivationKeyContentOverride created =
            this.activationKeyContentOverrideCurator.create(override);
        created.setValue("0");
        ActivationKeyContentOverride merged =
            this.activationKeyContentOverrideCurator.merge(created);
        assertEquals("0", merged.getValue());
    }
View Full Code Here

        assertEquals("0", merged.getValue());
    }

    @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());
    }
View Full Code Here

        assertEquals("gpgcheck", merged.getName());
    }

    @Test
    public void testRetrieveByName() {
        activationKeyContentOverrideCurator.create(new ActivationKeyContentOverride(key,
            "test-repo", "gpgcheck", "1"));
        ActivationKeyContentOverride found =
            activationKeyContentOverrideCurator.retrieve(key, "test-repo", "gpgcheck");
        assertNotNull(found);
        assertEquals(key, found.getKey());
        assertEquals("test-repo", found.getContentLabel());
        assertEquals("gpgcheck", found.getName());
        assertEquals("1", found.getValue());
    }
View Full Code Here

        assertEquals("1", found.getValue());
    }

    @Test
    public void testRetrieveByNameIsCaseInsensitive() {
        activationKeyContentOverrideCurator.create(new ActivationKeyContentOverride(key,
            "test-repo", "gpgcheck", "1"));
        ActivationKeyContentOverride found =
            activationKeyContentOverrideCurator.retrieve(key, "test-repo", "GPGCheck");
        assertNotNull(found);
        assertEquals(key, found.getKey());
        assertEquals("test-repo", found.getContentLabel());
        assertEquals("gpgcheck", found.getName());
        assertEquals("1", found.getValue());
    }
View Full Code Here

        assertEquals("1", found.getValue());
    }

    @Test
    public void testRetrieveByNameDoesntExist() {
        ActivationKeyContentOverride found =
            activationKeyContentOverrideCurator.retrieve(key, "not-a-repo", "gpgcheck");
        assertNull(found);
    }
View Full Code Here

        assertNull(found);
    }

    @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());
View Full Code Here

        assertEquals("remaining-override", remaining.get(0).getName());
    }

    @Test
    public void testRemoveByNameCaseInsensitive() {
        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());
View Full Code Here

TOP

Related Classes of org.candlepin.model.activationkeys.ActivationKeyContentOverride

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.