Package org.candlepin.model.activationkeys

Examples of org.candlepin.model.activationkeys.ActivationKeyContentOverride


    @Test
    public void testActivationKeyGetOverrides() {
        List<ActivationKeyContentOverride> overrides =
            new LinkedList<ActivationKeyContentOverride>();
        ActivationKeyContentOverride override =
            new ActivationKeyContentOverride(key, "label", "name", "value");
        overrides.add(override);

        when(activationKeyContentOverrideCurator.getList(eq(key))).thenReturn(overrides);
        List<ActivationKeyContentOverride> res =
            akcor.getContentOverrideList(context, principal);
View Full Code Here


        assertEquals(overrides, res);
    }

    @Test
    public void testActivationKeyDeleteOverride() {
        ActivationKeyContentOverride override =
            new ActivationKeyContentOverride(key, "label", "name", "test");

        List<ContentOverride> toDelete = new LinkedList<ContentOverride>();
        toDelete.add(override);
        akcor.deleteContentOverrides(context, principal, toDelete);
        verify(activationKeyContentOverrideCurator, Mockito.times(1))
            .removeByName(eq(key), eq(override.getContentLabel()), eq(override.getName()));
    }
View Full Code Here

            .removeByParent(eq(key));
    }

    @Test
    public void testActivationKeyAddOverrides() {
        ActivationKeyContentOverride override =
            new ActivationKeyContentOverride(key, "somelabel", "test", "test");
        ActivationKeyContentOverride otherOverride =
            new ActivationKeyContentOverride(key, "somelabel1", "test", "test");

        List<ContentOverride> toAdd = new LinkedList<ContentOverride>();
        toAdd.add(override);
        toAdd.add(otherOverride);
View Full Code Here

    }

    @Test
    public void testActivationKeyOverrideValidationIsRun() {
        List<ContentOverride> newOverrides = new LinkedList<ContentOverride>();
        newOverrides.add(new ActivationKeyContentOverride(key, "x", "baseurl", "x"));
        akcor.addContentOverrides(context, principal, newOverrides);
        verify(contentOverrideValidator, Mockito.times(1)).validate(eq(newOverrides));
    }
View Full Code Here

        activationKeyCurator.create(key);
    }

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

        assertEquals("value", cco2.getValue());
    }

    @Test
    public void normalCreateAndUpdate() {
        ActivationKeyContentOverride cco = new ActivationKeyContentOverride(
            key, "test-content", "name", "value");
        activationKeyContentOverrideCurator.create(cco);

        cco.setValue("value-update");
        activationKeyContentOverrideCurator.merge(cco);

        ActivationKeyContentOverride cco2 =
                activationKeyContentOverrideCurator.retrieve(
                    key, "test-content", "name");
        assert (cco2 != null);
        assertEquals("value-update", cco2.getValue());
    }
View Full Code Here

        assertEquals("value-update", cco2.getValue());
    }

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

        assert (cco2 == null);
    }

    @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 =
View Full Code Here

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

    @Test
    public void deleteByConsumer() {
        ActivationKeyContentOverride cco1 = new ActivationKeyContentOverride(
            key, "test-content1", "name1", "value");
        activationKeyContentOverrideCurator.create(cco1);
        ActivationKeyContentOverride cco2 = new ActivationKeyContentOverride(
            key, "test-content2", "name2", "value");
        activationKeyContentOverrideCurator.create(cco2);

        activationKeyContentOverrideCurator.removeByParent(key);
        List<ActivationKeyContentOverride> ccoList =
View Full Code Here

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

    @Test
    public void testAddOrUpdateUpdatesValue() {
        ActivationKeyContentOverride cco1 = new ActivationKeyContentOverride(
            key, "test-content1", "name1", "value");
        activationKeyContentOverrideCurator.create(cco1);
        ActivationKeyContentOverride cco2 = new ActivationKeyContentOverride(
            key, "test-content1", "name1", "value2");
        activationKeyContentOverrideCurator.addOrUpdate(key, cco2);

        List<ActivationKeyContentOverride> ccoList =
            activationKeyContentOverrideCurator.listAll();
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.