Package org.candlepin.model

Examples of org.candlepin.model.Owner


    }

    @Test
    public void ownerCreatedShouldEmitSuccessfully()
        throws Exception {
        Owner owner = new Owner("Test Owner ");
        eventSinkImpl.emitOwnerCreated(owner);
        eventSinkImpl.sendEvents();
        verify(mockClientProducer).send(any(ClientMessage.class));
    }
View Full Code Here


    }

    @Test
    public void importCreatedShouldEmitSuccessfully()
        throws Exception {
        Owner owner = new Owner("Import guy");
        eventSinkImpl.emitImportCreated(owner);
        eventSinkImpl.sendEvents();
        verify(mockClientProducer).send(any(ClientMessage.class));
    }
View Full Code Here

    }

    @Test
    public void emptyKeyShouldEmitSuccessfully()
        throws Exception {
        ActivationKey key = TestUtil.createActivationKey(new Owner("deadbeef"), null);
        eventSinkImpl.emitActivationKeyCreated(key);
        eventSinkImpl.sendEvents();
        verify(mockClientProducer).send(any(ClientMessage.class));
    }
View Full Code Here

    public void keyWithPoolsShouldEmitSuccessfully()
        throws Exception {
        ArrayList<Pool> pools = new ArrayList<Pool>();
        pools.add(TestUtil.createPool(TestUtil.createProduct()));
        pools.add(TestUtil.createPool(TestUtil.createProduct()));
        ActivationKey key = TestUtil.createActivationKey(new Owner("deadbeef"), pools);
        eventSinkImpl.emitActivationKeyCreated(key);
        eventSinkImpl.sendEvents();
        verify(mockClientProducer).send(any(ClientMessage.class));
    }
View Full Code Here

    public ConsumerType initSystem() {
        ConsumerType systemtype = new ConsumerType(
            ConsumerType.ConsumerTypeEnum.PERSON);
        // create an owner, a ownerperm, and roles for the user we prodive
        // as coming from userService
        owner = new Owner("test_owner");
        PermissionBlueprint p = new PermissionBlueprint(PermissionType.OWNER, owner,
            Access.ALL);
        User user = new User("anyuser", "");
        role = new Role();
        role.addPermission(p);
View Full Code Here

    public void setUp() {
        consumerResource = injector.getInstance(ConsumerResource.class);

        standardSystemType = consumerTypeCurator.create(
                new ConsumerType("standard-system"));
        owner = ownerCurator.create(new Owner("test-owner"));
        ownerCurator.create(owner);

        consumer = TestUtil.createConsumer(standardSystemType, owner);
        consumerCurator.create(consumer);
View Full Code Here

    private static final String CONSUMER_NAME = "Test Consumer";
    private static final String USER_NAME = "user33908";

    @Before
    public void setUpTestObjects() {
        owner = new Owner("Example Corporation");
        rhel = new Product("rhel", "Red Hat Enterprise Linux");
        jboss = new Product("jboss", "JBoss");

        ownerCurator.create(owner);
        productCurator.create(rhel);
View Full Code Here

    @Test
    public void superAdminCanCreateAnOwner() {
        setupAdminPrincipal("dude");
        securityInterceptor.enable();

        resource.createOwner(new Owner("Test Owner"));
        assertNotNull(ownerCurator.find(owner.getId()));
    }
View Full Code Here

    @Test(expected = ForbiddenException.class)
    public void ownerAdminCannotCreateAnOwner() {
        setupPrincipal(owner, Access.ALL);
        securityInterceptor.enable();

        resource.createOwner(new Owner("Test Owner"));
    }
View Full Code Here

    public void consumerCannotCreateAnOwner() {
        Consumer consumer = createConsumer(owner);
        setupPrincipal(new ConsumerPrincipal(consumer));
        securityInterceptor.enable();

        resource.createOwner(new Owner("Test Owner"));
    }
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.