Package org.candlepin.model

Examples of org.candlepin.model.Owner


    private Content c;
    private EnvironmentContent envContent;

    @Before
    public void setUp() {
        owner = new Owner("test-owner", "Test Owner");
        owner = ownerCurator.create(owner);

        e = new Environment("env1", "Env 1", owner);
        envCurator.create(e);
View Full Code Here


    private Session session;

    @Before
    public void setUp() {
        for (int i = 0; i < 10; i++) {
            Owner o = new Owner();
            o.setDisplayName(String.valueOf(i));
            o.setKey(String.valueOf(i));
            ownerCurator.create(o);
        }

        session = (Session) entityManager().getDelegate();
    }
View Full Code Here

    }

    private List<Owner> createOwners(int owners) {
        List<Owner> ownerList = new ArrayList<Owner>();
        for (int i = 0; i < owners; i++) {
            Owner o = new Owner();
            o.setDisplayName(String.valueOf(i));
            o.setKey(String.valueOf(i));
            ownerList.add(o);
        }
        return ownerList;
    }
View Full Code Here

public class MembershipTest extends DatabaseTestFixture {

    @Test
    public void testCreate() throws Exception {
        Owner o = new Owner("testowner");
        ownerCurator.create(o);
        Set<Owner> owners = new HashSet<Owner>();
        owners.add(o);

        String username = "TESTUSER";
View Full Code Here

        prod1 = TestUtil.createProduct();
        prod2 = TestUtil.createProduct();
        productCurator.create(prod1);
        productCurator.create(prod2);
        owner = new Owner("testowner");
        ownerCurator.create(owner);

        Set<ProvidedProduct> providedProducts = new HashSet<ProvidedProduct>();
        ProvidedProduct providedProduct = new ProvidedProduct(
            prod2.getId(), prod2.getName());
View Full Code Here

            "{\"uuid\":\"test-uuid\", \"unknown\":\"notreal\"}"));
    }

    @Test
    public void importConsumerWithNullUuidOnOwnerShouldSetUuid() throws ImporterException {
        Owner owner = mock(Owner.class);
        ConsumerDto consumer = mock(ConsumerDto.class);

        when(owner.getId()).thenReturn("test-owner-id");
        when(consumer.getUuid()).thenReturn("test-uuid");
        when(consumer.getOwner()).thenReturn(owner);

        IdentityCertificate idCert = new IdentityCertificate();
        idCert.setSerial(new CertificateSerial());
View Full Code Here

        verify(curator).merge(owner);
    }

    @Test
    public void importConsumerWithSameUuidOnOwnerShouldDoNothing() throws ImporterException {
        Owner owner = mock(Owner.class);
        ConsumerDto consumer = mock(ConsumerDto.class);
        when(owner.getUpstreamUuid()).thenReturn("test-uuid");
        when(consumer.getUuid()).thenReturn("test-uuid");
        when(consumer.getOwner()).thenReturn(owner);

        IdentityCertificate idCert = new IdentityCertificate();
        idCert.setSerial(new CertificateSerial());
View Full Code Here

    }

    @Test(expected = SyncDataFormatException.class)
    public void importConsumerWithSameUuidOnAnotherOwnerShouldThrowException()
        throws ImporterException {
        Owner owner = new Owner();
        UpstreamConsumer uc = new UpstreamConsumer("test-uuid");
        owner.setUpstreamConsumer(uc);
        ConsumerDto consumer = new ConsumerDto();
        consumer.setUuid("test-uuid");

        Owner anotherOwner = new Owner("other", "Other");
        anotherOwner.setId("blah");
        anotherOwner.setUpstreamConsumer(uc);
        when(curator.lookupWithUpstreamUuid(consumer.getUuid())).thenReturn(anotherOwner);

        importer.store(owner, consumer, new ConflictOverrides(), null);
    }
View Full Code Here

        when(rulesCuratorMock.getUpdated()).thenReturn(new Date());
        when(rulesCuratorMock.getRules()).thenReturn(rules);
        provider = new JsRunnerProvider(rulesCuratorMock);
        quantityRules = new QuantityRules(provider.get());

        owner = new Owner("Test Owner " + TestUtil.randomInt());
        product = TestUtil.createProduct();
        pool = TestUtil.createPool(owner, product);

        consumer = TestUtil.createConsumer(owner);
        Entitlement e = TestUtil.createEntitlement(owner, consumer, pool,
View Full Code Here

        importer.store(owner, consumer, new ConflictOverrides(), null);
    }

    @Test
    public void importConsumerWithMismatchedUuidShouldThrowException() throws ImporterException {
        Owner owner = mock(Owner.class);
        ConsumerDto consumer = mock(ConsumerDto.class);
        when(owner.getUpstreamUuid()).thenReturn("another-test-uuid");
        when(consumer.getUuid()).thenReturn("test-uuid");
        when(consumer.getOwner()).thenReturn(owner);

        try {
            importer.store(owner, consumer, new ConflictOverrides(), 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.