Examples of SubscriptionServiceAdapter


Examples of org.candlepin.service.SubscriptionServiceAdapter

        IdentityCertServiceAdapter mockedIdSvc = Mockito
            .mock(IdentityCertServiceAdapter.class);

        EventSink sink = Mockito.mock(EventSinkImpl.class);

        SubscriptionServiceAdapter ssa = Mockito.mock(SubscriptionServiceAdapter.class);
        ComplianceRules rules = Mockito.mock(ComplianceRules.class);

        Consumer consumer = createConsumer();
        ComplianceStatus status = new ComplianceStatus();
        when(rules.getStatus(any(Consumer.class), any(Date.class), anyBoolean())).thenReturn(status);
View Full Code Here

Examples of org.candlepin.service.SubscriptionServiceAdapter

        assertFalse(origserial.equals(c.getIdCert().getSerial().getSerial()));
    }

    @Test
    public void testIdCertDoesNotRegenerate() throws Exception {
        SubscriptionServiceAdapter ssa = Mockito.mock(SubscriptionServiceAdapter.class);
        ComplianceRules rules = Mockito.mock(ComplianceRules.class);

        Consumer consumer = createConsumer();
        ComplianceStatus status = new ComplianceStatus();
        when(rules.getStatus(any(Consumer.class), any(Date.class), anyBoolean())).thenReturn(status);
View Full Code Here

Examples of org.candlepin.service.SubscriptionServiceAdapter

    @Test
    public void testProductNoPool() {
        try {
            Consumer c = mock(Consumer.class);
            Owner o = mock(Owner.class);
            SubscriptionServiceAdapter sa = mock(SubscriptionServiceAdapter.class);
            Entitler e = mock(Entitler.class);
            ConsumerCurator cc = mock(ConsumerCurator.class);
            String[] prodIds = {"notthere"};

            when(c.getOwner()).thenReturn(o);
            when(sa.hasUnacceptedSubscriptionTerms(eq(o))).thenReturn(false);
            when(cc.verifyAndLookupConsumer(eq("fakeConsumer"))).thenReturn(c);
            when(e.bindByProducts(any(AutobindData.class)))
                .thenThrow(new RuntimeException());

            ConsumerResource cr = new ConsumerResource(cc, null,
View Full Code Here

Examples of org.candlepin.service.SubscriptionServiceAdapter

    @Test
    public void futureHealing() {
        Consumer c = mock(Consumer.class);
        Owner o = mock(Owner.class);
        SubscriptionServiceAdapter sa = mock(SubscriptionServiceAdapter.class);
        Entitler e = mock(Entitler.class);
        ConsumerCurator cc = mock(ConsumerCurator.class);
        ConsumerInstalledProduct cip = mock(ConsumerInstalledProduct.class);
        Set<ConsumerInstalledProduct> products = new HashSet<ConsumerInstalledProduct>();
        products.add(cip);

        when(c.getOwner()).thenReturn(o);
        when(cip.getProductId()).thenReturn("product-foo");
        when(sa.hasUnacceptedSubscriptionTerms(eq(o))).thenReturn(false);
        when(cc.verifyAndLookupConsumer(eq("fakeConsumer"))).thenReturn(c);

        ConsumerResource cr = new ConsumerResource(cc, null, null, sa,
            null, null, null, null, null, null, null, null, null, null,
            null, null, null, null, e, null, null, null, null,
View Full Code Here

Examples of org.candlepin.service.SubscriptionServiceAdapter

                .thenReturn("mega");

        Consumer consumer = Mockito.mock(Consumer.class);
        Mockito.when(consumer.getName()).thenReturn("megaman");

        SubscriptionServiceAdapter adapter =
                new DefaultSubscriptionServiceAdapter(null, config, null, null);

        assertTrue(adapter.canActivateSubscription(consumer));
    }
View Full Code Here

Examples of org.candlepin.service.SubscriptionServiceAdapter

                .thenReturn("mega");

        Consumer consumer = Mockito.mock(Consumer.class);
        Mockito.when(consumer.getName()).thenReturn("superman");

        SubscriptionServiceAdapter adapter =
                new DefaultSubscriptionServiceAdapter(null, config, null, null);

        assertFalse(adapter.canActivateSubscription(consumer));
    }
View Full Code Here

Examples of org.candlepin.service.SubscriptionServiceAdapter

                .thenReturn("");

        Consumer consumer = Mockito.mock(Consumer.class);
        Mockito.when(consumer.getName()).thenReturn("anything");

        SubscriptionServiceAdapter adapter =
                new DefaultSubscriptionServiceAdapter(null, config, null, null);

        assertFalse(adapter.canActivateSubscription(consumer));
    }
View Full Code Here

Examples of org.candlepin.service.SubscriptionServiceAdapter

                .thenReturn(null);

        Consumer consumer = Mockito.mock(Consumer.class);
        Mockito.when(consumer.getName()).thenReturn("anything");

        SubscriptionServiceAdapter adapter =
                new DefaultSubscriptionServiceAdapter(null, config, null, null);

        assertFalse(adapter.canActivateSubscription(consumer));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.