Package org.candlepin.resource.dto

Examples of org.candlepin.resource.dto.AutobindData


            null, null, null, null, e, null, null, null, null,
            new CandlepinCommonTestConfig(), null, null, null, consumerBindUtil);
        String dtStr = "2011-09-26T18:10:50.184081+00:00";
        Date dt = ResourceDateParser.parseDateString(dtStr);
        cr.bind("fakeConsumer", null, null, null, null, null, false, dtStr, null);
        AutobindData data = AutobindData.create(c).on(dt);
        verify(e).bindByProducts(eq(data));
    }
View Full Code Here


        Set<ConsumerInstalledProduct> cips = new HashSet<ConsumerInstalledProduct>();
        ConsumerInstalledProduct cip = new ConsumerInstalledProduct(prod.getId(), prod.getName());
        cips.add(cip);
        consumer.setInstalledProducts(cips);

        AutobindData ad = new AutobindData(consumer).withPools(poolIds).forProducts(prodIds);
        consumerBindUtil.handleActivationKeys(consumer, keys);
        verify(entitler).bindByProducts(eq(ad));
    }
View Full Code Here

        Set<ConsumerInstalledProduct> cips = new HashSet<ConsumerInstalledProduct>();
        ConsumerInstalledProduct cip = new ConsumerInstalledProduct(prod.getId(), prod.getName());
        cips.add(cip);
        consumer.setInstalledProducts(cips);

        AutobindData ad = new AutobindData(consumer).forProducts(prodIds);
        consumerBindUtil.handleActivationKeys(consumer, keys);
        verify(entitler).bindByProducts(eq(ad));
    }
View Full Code Here

        Set<ConsumerInstalledProduct> cips = new HashSet<ConsumerInstalledProduct>();
        ConsumerInstalledProduct cip = new ConsumerInstalledProduct(prod1.getId(), prod1.getName());
        cips.add(cip);
        consumer.setInstalledProducts(cips);

        AutobindData ad = new AutobindData(consumer).forProducts(prodIds);
        consumerBindUtil.handleActivationKeys(consumer, keys);
        verify(entitler).bindByProducts(eq(ad));
    }
View Full Code Here

        when(autobindRules.selectBestPools(any(Consumer.class), any(String[].class),
            any(List.class), any(ComplianceStatus.class), any(String.class),
            any(Set.class), eq(false)))
            .thenReturn(bestPools);

        AutobindData data = AutobindData.create(TestUtil.createConsumer(o))
                .forProducts(new String[] { product.getId() }).on(now);
        List<Entitlement> e = manager.entitleByProducts(data);

        assertNotNull(e);
        assertEquals(e.size(), 1);
View Full Code Here

            any(List.class), any(ComplianceStatus.class), any(String.class),
            any(Set.class), eq(false)))
            .thenReturn(bestPools);

        // Make the call but provide a null array of product IDs (simulates healing):
        AutobindData data = AutobindData.create(TestUtil.createConsumer(o)).on(now);
        manager.entitleByProducts(data);

        verify(autobindRules).selectBestPools(any(Consumer.class), eq(installedPids),
            any(List.class), eq(mockCompliance), any(String.class),
            any(Set.class), eq(false));
View Full Code Here

                productIds.add(cip.getProductId());
            }
            for (ActivationKeyPool p : key.getPools()) {
                poolIds.add(p.getPool().getId());
            }
            AutobindData autobindData = AutobindData.create(consumer)
                    .forProducts(productIds.toArray(new String[0]))
                    .withPools(poolIds);
            List<Entitlement> ents = entitler.bindByProducts(autobindData);
            entitler.sendEvents(ents);
        }
View Full Code Here

    @Test
    public void bindByProductsString() throws EntitlementRefusedException {
        String[] pids = {"prod1", "prod2", "prod3"};
        when(cc.findByUuid(eq("abcd1234"))).thenReturn(consumer);
        entitler.bindByProducts(pids, "abcd1234", null, null);
        AutobindData data = AutobindData.create(consumer).forProducts(pids);
        verify(pm).entitleByProducts(eq(data));
    }
View Full Code Here

    }

    @Test
    public void bindByProducts() throws EntitlementRefusedException {
        String[] pids = {"prod1", "prod2", "prod3"};
        AutobindData data = AutobindData.create(consumer).forProducts(pids);
        entitler.bindByProducts(data);
        verify(pm).entitleByProducts(data);
    }
View Full Code Here

    private void bindByProductErrorTest(String msg) {
        try {
            String[] pids = {"prod1", "prod2", "prod3"};
            EntitlementRefusedException ere = new EntitlementRefusedException(
                fakeOutResult(msg));
            AutobindData data = AutobindData.create(consumer).forProducts(pids);
            when(pm.entitleByProducts(data)).thenThrow(ere);
            entitler.bindByProducts(data);
        }
        catch (EntitlementRefusedException e) {
            fail(msg + ": threw unexpected error");
View Full Code Here

TOP

Related Classes of org.candlepin.resource.dto.AutobindData

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.