Package org.candlepin.model

Examples of org.candlepin.model.Owner


        }
    }

    @Test
    public void importConsumerWithMismatchedUuidShouldNotThrowExceptionIfForced() 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);

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


        verify(curator).merge(owner);
    }

    @Test(expected = ImporterException.class)
    public void importConsumerWithNullUuidOnConsumerShouldThrowException() throws ImporterException {
        Owner owner = new Owner();
        ConsumerDto consumer = new ConsumerDto();
        consumer.setUuid(null);

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

    /*
     * BZ#966860
     */
    @Test
    public void importConsumerWithNullIdCertShouldNotFail() 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);

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

View Full Code Here

        this.job = injector.getInstance(ImportRecordJob.class);
    }

    @Test
    public void noRecords() throws Exception {
        Owner owner = new Owner("owner");
        Owner another = new Owner("another_owner");
        ownerCurator.create(owner);
        ownerCurator.create(another);

        // just make sure that running this on owners with no records
        // doesn't blow up
View Full Code Here

        this.job.execute(null);
    }

    @Test
    public void singleOwner() throws Exception {
        Owner owner = new Owner("owner");
        ownerCurator.create(owner);

        for (int i = 0; i < 13; i++) {
            ImportRecord record = new ImportRecord(owner);
            record.recordStatus(ImportRecord.Status.SUCCESS, "great!");
View Full Code Here

        Assert.assertEquals(10, records.size());
    }

    @Test
    public void lessThanThreshold() throws Exception {
        Owner owner = new Owner("owner");
        ownerCurator.create(owner);

        for (int i = 0; i < 7; i++) {
            ImportRecord record = new ImportRecord(owner);
            record.recordStatus(ImportRecord.Status.SUCCESS, "great!");
View Full Code Here

        Assert.assertEquals(7, records.size());
    }

    @Test
    public void multipleOwners() throws Exception {
        Owner owner1 = new Owner("owner1");
        Owner owner2 = new Owner("owner2");
        ownerCurator.create(owner1);
        ownerCurator.create(owner2);

        for (int i = 0; i < 23; i++) {
            ImportRecord record = new ImportRecord(owner1);
View Full Code Here

        verify(ctx).setResult(eq("Pools refreshed for owner test owner"));
    }

    @Test
    public void forOwner() {
        Owner owner = mock(Owner.class);
        when(owner.getKey()).thenReturn("owner key");

        JobDetail detail = RefreshPoolsJob.forOwner(owner, true);
        assertNotNull(detail);
        assertNotNull(detail.getJobDataMap());
        assertTrue(detail.requestsRecovery());
View Full Code Here

        }
        return poolCurator.create(p);
    }

    protected Owner createOwner() {
        Owner o = new Owner("Test Owner " + TestUtil.randomInt());
        ownerCurator.create(o);
        return o;
    }
View Full Code Here

        JobDataMap map = new JobDataMap();
        map.put("owner_key", "admin");
        map.put("uri", "http://foo.example.com/candlepin");
        map.put("delete", true);

        Owner owner = mock(Owner.class);
        when(ownerCurator.lookupByKey(eq("admin"))).thenReturn(owner);
        when(consumerCurator.listByOwner(any(Owner.class))).thenReturn(consumers);
        when(entCurator.find(eq("ff8080812e9"))).thenReturn(ent);

        // test it :)
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.