Package org.candlepin.model

Examples of org.candlepin.model.ConsumerContentOverride


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

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


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

    @Test
    public void testModifyOverrideForcesNameToLowercase() {
        ConsumerContentOverride override = new ConsumerContentOverride(consumer,
            "test-repo", "gpgcheck", "0");
        ConsumerContentOverride created =
            this.consumerContentOverrideCurator.create(override);
        created.setName("GPGCHECK");
        ConsumerContentOverride merged = this.consumerContentOverrideCurator.merge(created);
        assertEquals("gpgcheck", merged.getName());
    }
View Full Code Here

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

    @Test
    public void testRetrieveByName() {
        consumerContentOverrideCurator.create(new ConsumerContentOverride(consumer,
            "test-repo", "gpgcheck", "1"));
        ConsumerContentOverride found =
            consumerContentOverrideCurator.retrieve(consumer, "test-repo", "gpgcheck");
        assertNotNull(found);
        assertEquals(consumer, found.getConsumer());
        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() {
        consumerContentOverrideCurator.create(new ConsumerContentOverride(consumer,
            "test-repo", "gpgcheck", "1"));
        ConsumerContentOverride found =
            consumerContentOverrideCurator.retrieve(consumer, "test-repo", "GPGCheck");
        assertNotNull(found);
        assertEquals(consumer, found.getConsumer());
        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() {
        ConsumerContentOverride found =
            consumerContentOverrideCurator.retrieve(consumer, "not-a-repo", "gpgcheck");
        assertNull(found);
    }
View Full Code Here

        assertNull(found);
    }

    @Test
    public void testRemoveByName() {
        consumerContentOverrideCurator.create(new ConsumerContentOverride(consumer,
            "test-repo", "gpgcheck", "1"));
        consumerContentOverrideCurator.create(new ConsumerContentOverride(consumer,
            "test-repo", "remaining-override", "remaining"));
        consumerContentOverrideCurator.removeByName(consumer, "test-repo", "gpgcheck");
        List<ConsumerContentOverride> remaining =
            consumerContentOverrideCurator.getList(consumer);
        assertEquals(1, remaining.size());
View Full Code Here

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

    @Test
    public void testRemoveByNameCaseInsensitive() {
        consumerContentOverrideCurator.create(new ConsumerContentOverride(consumer,
            "test-repo", "gpgcheck", "1"));
        consumerContentOverrideCurator.create(new ConsumerContentOverride(consumer,
            "test-repo", "remaining-override", "remaining"));
        consumerContentOverrideCurator.removeByName(consumer, "test-repo", "GpGChecK");
        List<ConsumerContentOverride> remaining =
            consumerContentOverrideCurator.getList(consumer);
        assertEquals(1, remaining.size());
View Full Code Here

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

    @Test
    public void testRemoveByContentLabel() {
        consumerContentOverrideCurator.create(new ConsumerContentOverride(consumer,
            "test-repo", "gpgcheck", "1"));
        consumerContentOverrideCurator.create(new ConsumerContentOverride(consumer,
            "test-repo", "foo", "foo-v"));
        consumerContentOverrideCurator.create(new ConsumerContentOverride(consumer,
            "should-remain", "remaining", "true"));
        consumerContentOverrideCurator.removeByContentLabel(consumer, "test-repo");
        List<ConsumerContentOverride> remaining =
            consumerContentOverrideCurator.getList(consumer);
        assertEquals(1, remaining.size());
View Full Code Here

    }

    @Test
    public void testRemoveByConsumer() {
        Consumer consumer2 = createConsumer(owner);
        consumerContentOverrideCurator.create(new ConsumerContentOverride(consumer2,
            "test-repo", "gpgcheck", "1"));

        consumerContentOverrideCurator.create(new ConsumerContentOverride(consumer,
            "test-repo", "gpgcheck", "1"));
        consumerContentOverrideCurator.create(new ConsumerContentOverride(consumer,
            "another-test-repo", "gpgcheck", "0"));
        consumerContentOverrideCurator.removeByParent(consumer);

        assertTrue(consumerContentOverrideCurator.getList(consumer).isEmpty());
        assertEquals(1, consumerContentOverrideCurator.getList(consumer2).size());
View Full Code Here

    }

    @Test
    public void testAddOverride() {
        List<ContentOverride> entries = new LinkedList<ContentOverride>();
        ConsumerContentOverride toAdd = new ConsumerContentOverride(consumer, "label",
            "overridename", "overridevalue");
        entries.add(toAdd);
        resource.addContentOverrides(context, principal, entries);
        Mockito.verify(consumerContentOverrideCurator,
            Mockito.times(1)).addOrUpdate(consumer, toAdd);
View Full Code Here

TOP

Related Classes of org.candlepin.model.ConsumerContentOverride

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.