Package org.candlepin.controller

Examples of org.candlepin.controller.CandlepinPoolManager


public class RegenEntitlementCertsJobTest {

    @Test
    public void execute() throws Exception {
        // prep
        CandlepinPoolManager pm = mock(CandlepinPoolManager.class);
        JobExecutionContext jec = mock(JobExecutionContext.class);
        JobDetail detail = mock(JobDetail.class);
        JobDataMap jdm = mock(JobDataMap.class);

        when(jdm.getString(eq("product_id"))).thenReturn("foobarbaz");
View Full Code Here


        Pool consumerPool = createPoolAndSub(owner, newProduct,
            numAvailEntitlements, TestUtil.createDate(2009, 11, 30),
            TestUtil.createDate(2050, 11, 30));
        consumerPool = poolCurator.create(consumerPool);

        CandlepinPoolManager anotherEntitler =
            injector.getInstance(CandlepinPoolManager.class);

        anotherEntitler.entitleByPool(consumer, consumerPool, 1);
        anotherEntitler.entitleByPool(consumer, consumerPool, 1);

        assertFalse(poolCurator.find(consumerPool.getId())
                .entitlementsAvailable(1));
    }
View Full Code Here

        Pool consumerPool = createPoolAndSub(owner, newProduct, numAvailEntitlements,
            TestUtil.createDate(2009, 11, 30), TestUtil.createDate(2050, 11, 30));
        poolCurator.create(consumerPool);

        CandlepinPoolManager anotherEntitler =
            injector.getInstance(CandlepinPoolManager.class);

        Entitlement e1 = poolManager.entitleByPool(consumer, consumerPool, 1);
        assertNotNull(e1);

        anotherEntitler.entitleByPool(consumer, consumerPool, 1);
    }
View Full Code Here

        when(mockedSubscriptionServiceAdapter.getSubscription(eq("4444"))).thenReturn(s);
        when(mockedEntitlementCertServiceAdapter.generateEntitlementCert(
            any(Entitlement.class), any(Subscription.class), any(Product.class)))
            .thenThrow(new IOException());

        CandlepinPoolManager poolManager = new CandlepinPoolManager(null,
            mockedSubscriptionServiceAdapter, null,
            mockedEntitlementCertServiceAdapter, null, null,
            new CandlepinCommonTestConfig(), null, null,
            mockedEntitlementCurator, mockedConsumerCurator, null, null, null,
            mockedActivationKeyRules);
View Full Code Here

        Consumer consumer = createConsumer();

        when(mockedConsumerCurator.verifyAndLookupConsumer(consumer.getUuid())).thenReturn(
            consumer);

        CandlepinPoolManager mgr = mock(CandlepinPoolManager.class);
        ConsumerResource cr = new ConsumerResource(mockedConsumerCurator, null,
            null, null, null, null, null, null, null, null, null, null, null,
            null, mgr, null, null, null, null, null, null, null, null,
            new CandlepinCommonTestConfig(), null, null, null, consumerBindUtil);
        cr.regenerateEntitlementCertificates(consumer.getUuid(), null, true);
View Full Code Here

TOP

Related Classes of org.candlepin.controller.CandlepinPoolManager

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.