Package org.candlepin.model

Examples of org.candlepin.model.Owner


        assertTrue(results.isEmpty());
    }

    @Test
    public void lookupByUpstreamUuid() {
        Owner owner = new Owner("owner1");
        // setup some data
        owner = ownerCurator.create(owner);
        ConsumerType type = new ConsumerType(ConsumerTypeEnum.CANDLEPIN);
        consumerTypeCurator.create(type);
        UpstreamConsumer uc = new UpstreamConsumer("test-upstream-consumer",
               owner, type, "someuuid");
        owner.setUpstreamConsumer(uc);
        ownerCurator.merge(owner);

        // ok let's see if this works
        Owner found = ownerCurator.lookupWithUpstreamUuid("someuuid");

        // verify all is well in the world
        assertNotNull(found);
        assertEquals(owner.getId(), found.getId());
    }
View Full Code Here


    @Test
    public void getConsumerUuids() {
        ConsumerType type = new ConsumerType(ConsumerTypeEnum.SYSTEM);
        consumerTypeCurator.create(type);

        Owner owner = new Owner("owner");
        Owner otherOwner = new Owner("other owner");

        ownerCurator.create(owner);
        ownerCurator.create(otherOwner);

        Consumer c1 = new Consumer("name1", "uname1", owner, type);
View Full Code Here

        config.setProperty(ConfigProperties.NON_NEG_LONG_ATTRIBUTES,
            "product.long_pos_count");
        config.setProperty(ConfigProperties.BOOLEAN_ATTRIBUTES,
            "product.bool_val_str, product.bool_val_num");

        Owner owner = createOwner();
        ownerCurator.create(owner);

        product = TestUtil.createProduct();
        productCurator.create(product);
View Full Code Here

    @Test
    public void testGetOwners() {
        String username = "TESTUSER";
        String password = "sekretpassword";
        Owner owner1 = new Owner("owner1", "owner one");
        Owner owner2 = new Owner("owner2", "owner two");
        User user = new User(username, password);

        Set<Owner> owners = user.getOwners(null, Access.ALL);
        assertEquals(0, owners.size());
        user.addPermissions(new TestPermission(owner1));
View Full Code Here

    @Test
    public void testGetOwnersCoversCreateConsumers() {
        String username = "TESTUSER";
        String password = "sekretpassword";
        Owner owner1 = new Owner("owner1", "owner one");
        Owner owner2 = new Owner("owner2", "owner two");
        User user = new User(username, password);

        Set<Owner> owners = user.getOwners(null, Access.ALL);
        assertEquals(0, owners.size());
        user.addPermissions(new TestPermission(owner1));
View Full Code Here

    @Test
    public void testGetOwnersNonOwnerPerm() {
        String username = "TESTUSER";
        String password = "sekretpassword";
        Owner owner1 = new Owner("owner1", "owner one");
        Owner owner2 = new Owner("owner2", "owner two");
        User user = new User(username, password);

        Set<Owner> owners = user.getOwners(null, Access.ALL);
        assertEquals(0, owners.size());
        user.addPermissions(new OtherPermission(owner1));
View Full Code Here

        @Override
        public boolean canAccess(Object target, SubResource subResource,
            Access access) {
            if (target instanceof Owner) {
                Owner targetOwner = (Owner) target;
                return targetOwner.getKey().equals(this.getOwner().getKey());
            }
            return false;
        }
View Full Code Here

        uc = new UpstreamConsumer("someuuid");
    }

    @Test
    public void ctor() {
        Owner o = mock(Owner.class);
        ConsumerType ct = mock(ConsumerType.class);
        UpstreamConsumer luc = new UpstreamConsumer("fake name", o, ct, "someuuid");
        assertEquals("someuuid", luc.getUuid());
        assertEquals("fake name", luc.getName());
        assertEquals(o.getId(), luc.getOwnerId());
        assertEquals(ct, luc.getType());
    }
View Full Code Here

        assertEquals(null, luc.getType());
    }

    @Test
    public void owner() {
        Owner o = mock(Owner.class);
        uc.setOwnerId(o.getId());
        assertEquals(o.getId(), uc.getOwnerId());
    }
View Full Code Here

        assertEquals("some-fake-url", uc.getApiUrl());
    }

    @Test(expected = IllegalArgumentException.class)
    public void exception() {
        Owner o = mock(Owner.class);
        ConsumerType ct = mock(ConsumerType.class);
        new UpstreamConsumer("fake name", o, ct, null);
    }
View Full Code Here

TOP

Related Classes of org.candlepin.model.Owner

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.