Package org.candlepin.model

Examples of org.candlepin.model.ConsumerType


        return consumer;
    }

    public static ConsumerType createConsumerType() {
        return new ConsumerType("test-consumer-type-" + randomInt());
    }
View Full Code Here


            productCache, I18nFactory.getI18n(getClass(), Locale.US,
                I18nFactory.FALLBACK), config, consumerCurator, poolCurator);

        owner = new Owner();
        consumer = new Consumer("test consumer", "test user", owner,
            new ConsumerType(ConsumerTypeEnum.SYSTEM));

        attrHelper = new AttributeHelper();

        poolRules = new PoolRules(poolManagerMock, productCache, config,
            entCurMock);
View Full Code Here

        entResource.getUpstreamCert(e.getId());
    }

    @Test(expected = BadRequestException.class)
    public void migrateEntitlementQuantityFail() {
        ConsumerType ct = TestUtil.createConsumerType();
        ct.setManifest(true);
        Entitlement e = TestUtil.createEntitlement();
        Consumer sourceConsumer = new Consumer("source-consumer", "bill", owner, ct);
        Consumer destConsumer = new Consumer("destination-consumer", "bill", owner, ct);
        e.setConsumer(sourceConsumer);
        e.setQuantity(25);
View Full Code Here

        entResource.migrateEntitlement(e.getId(), destConsumer.getUuid(), 30);
    }

    @Test(expected = BadRequestException.class)
    public void migrateEntitlementSourceConsumerFail() {
        ConsumerType ct = TestUtil.createConsumerType();
        ct.setManifest(true);
        Entitlement e = TestUtil.createEntitlement();
        Consumer destConsumer = new Consumer("destination-consumer", "bill", owner, ct);
        e.setConsumer(consumer);
        e.setQuantity(25);
View Full Code Here

        entResource.migrateEntitlement(e.getId(), destConsumer.getUuid(), 15);
    }

    @Test(expected = BadRequestException.class)
    public void migrateEntitlementDestinationConsumerFail() {
        ConsumerType ct = TestUtil.createConsumerType();
        ct.setManifest(true);
        Entitlement e = TestUtil.createEntitlement();
        Consumer sourceConsumer = new Consumer("source-consumer", "bill", owner, ct);
        e.setConsumer(sourceConsumer);
        e.setQuantity(25);
View Full Code Here

            .thenReturn("privateKey".getBytes());
        when(pki.getPemEncoded(keyPair.getPublicKey()))
            .thenReturn("publicKey".getBytes());
        when(consumer.getUuid()).thenReturn("8auuid");
        when(consumer.getName()).thenReturn("consumer_name");
        when(consumer.getType()).thenReturn(new ConsumerType(ConsumerTypeEnum.CANDLEPIN));

        // FINALLY test this badboy
        Exporter e = new Exporter(ctc, me, ce, cte, re, ece, ecsa, pe, psa,
            pce, ec, ee, pki, config, exportRules, pprov, dvc, dve, cdnc, cdne);
        File export = e.getFullExport(consumer);
View Full Code Here

        entResource.migrateEntitlement(e.getId(), consumer.getUuid(), 15);
    }

    @Test(expected = BadRequestException.class)
    public void migrateEntitlementSameOwnerFail() {
        ConsumerType ct = TestUtil.createConsumerType();
        ct.setManifest(true);
        Entitlement e = TestUtil.createEntitlement();
        Owner owner2 = new Owner("admin2");
        Consumer sourceConsumer = new Consumer("source-consumer", "bill", owner, ct);
        Consumer destConsumer = new Consumer("destination-consumer", "bill", owner2, ct);
        e.setConsumer(sourceConsumer);
View Full Code Here

            .thenReturn("privateKey".getBytes());
        when(pki.getPemEncoded(keyPair.getPublicKey()))
            .thenReturn("publicKey".getBytes());
        when(consumer.getUuid()).thenReturn("8auuid");
        when(consumer.getName()).thenReturn("consumer_name");
        when(consumer.getType()).thenReturn(new ConsumerType(ConsumerTypeEnum.CANDLEPIN));

        DistributorVersion dv = new DistributorVersion("test-dist-ver");
        Set<DistributorVersionCapability> dvcSet =
            new HashSet<DistributorVersionCapability>();
        dvcSet.add(new DistributorVersionCapability(dv, "capability-1"));
View Full Code Here

    @Test
    public void postEntitlement() {
        Consumer c = mock(Consumer.class);
        PoolHelper ph = mock(PoolHelper.class);
        Entitlement e = mock(Entitlement.class);
        ConsumerType type = mock(ConsumerType.class);
        Pool pool = mock(Pool.class);
        Product product = mock(Product.class);

        when(e.getPool()).thenReturn(pool);
        when(e.getConsumer()).thenReturn(c);
        when(c.getType()).thenReturn(type);
        when(type.isManifest()).thenReturn(true);
        when(pool.getProductId()).thenReturn("testProd");
        when(prodAdapter.getProductById(eq("testProd"))).thenReturn(product);
        when(product.getAttributes()).thenReturn(new HashSet<ProductAttribute>());
        when(pool.getAttributes()).thenReturn(new HashSet<PoolAttribute>());
View Full Code Here

        return e;
    }

    private Consumer mockConsumer(String ... installedProducts) {
        Consumer c = new Consumer();
        c.setType(new ConsumerType(ConsumerType.ConsumerTypeEnum.SYSTEM));
        for (String pid : installedProducts) {
            c.addInstalledProduct(new ConsumerInstalledProduct(pid, pid));
        }
        c.setFact("cpu.cpu_socket(s)", "4");
        return c;
View Full Code Here

TOP

Related Classes of org.candlepin.model.ConsumerType

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.