Package org.candlepin.policy.js.compliance

Examples of org.candlepin.policy.js.compliance.ComplianceStatus


            PRODUCT_1));
        c.addEntitlement(mockStackedEntitlement(c, range2, STACK_ID_1, PRODUCT_1, 1,
            PRODUCT_1));
        List<Entitlement> ents = new LinkedList<Entitlement>(c.getEntitlements());
        mockEntCurator(c, ents);
        ComplianceStatus status = compliance.getStatus(c, now);
        assertEquals("partial", status.getStatus());
        assertTrue(status.getPartialStacks().containsKey(STACK_ID_1));
    }
View Full Code Here


            PRODUCT_1));

        List<Entitlement> ents = new LinkedList<Entitlement>(c.getEntitlements());
        mockEntCurator(c, ents);

        ComplianceStatus status = compliance.getStatus(c, now);
        ConsumerInstalledProductEnricher calculator =
            new ConsumerInstalledProductEnricher(c, status, compliance);
        Product p = new Product(PRODUCT_1, "Awesome Product");
        DateRange validRange = calculator.getValidDateRange(p);
        assertEquals(range3.getStartDate(), validRange.getStartDate());
View Full Code Here

        c.addEntitlement(mockEntitlement(c, PRODUCT_1, range3, PRODUCT_1));

        List<Entitlement> ents = new LinkedList<Entitlement>(c.getEntitlements());
        mockEntCurator(c, ents);

        ComplianceStatus status = compliance.getStatus(c, now);
        ConsumerInstalledProductEnricher calculator =
            new ConsumerInstalledProductEnricher(c, status, compliance);
        Product p = new Product(PRODUCT_1, "Awesome Product");
        DateRange validRange = calculator.getValidDateRange(p);
        assertEquals(range3.getStartDate(), validRange.getStartDate());
View Full Code Here

        c.addEntitlement(mockEntitlement(c, PRODUCT_1, range2, PRODUCT_1));

        List<Entitlement> ents = new LinkedList<Entitlement>(c.getEntitlements());
        mockEntCurator(c, ents);

        ComplianceStatus status = compliance.getStatus(c, now);
        ConsumerInstalledProductEnricher calculator =
            new ConsumerInstalledProductEnricher(c, status, compliance);
        Product p = new Product(PRODUCT_1, "Awesome Product");
        DateRange validRange = calculator.getValidDateRange(p);
        assertEquals(range2.getStartDate(), validRange.getStartDate());
View Full Code Here

        c.addEntitlement(hpvsrEnt);

        List<Entitlement> ents = new LinkedList<Entitlement>(c.getEntitlements());
        mockEntCurator(c, ents);

        ComplianceStatus status = compliance.getStatus(c, now);
        assertEquals("valid", status.getStatus());
        ConsumerInstalledProductEnricher calculator =
            new ConsumerInstalledProductEnricher(c, status, compliance);
        Product p1 = new Product(PRODUCT_1, "Awesome Product");
        DateRange validRange = calculator.getValidDateRange(p1);
        assertNotNull(validRange);
View Full Code Here

            this.deletedConsumerCurator, this.environmentCurator, null,
            new CandlepinCommonTestConfig(), null, null, null, this.consumerBindUtil);

        when(complianceRules.getStatus(any(Consumer.class), any(Date.class),
                any(Boolean.class), any(Boolean.class)))
            .thenReturn(new ComplianceStatus(new Date()));

        when(idCertService.regenerateIdentityCert(any(Consumer.class)))
            .thenReturn(new IdentityCertificate());

        when(consumerEventBuilder.setNewEntity(any(Consumer.class)))
View Full Code Here

        autobindRules = new AutobindRules(jsRules, productCache);

        owner = new Owner();
        consumer = new Consumer("test consumer", "test user", owner,
            new ConsumerType(ConsumerTypeEnum.SYSTEM));
        compliance = new ComplianceStatus();
        activeGuestAttrs = new HashMap<String, String>();
        activeGuestAttrs.put("virtWhoType", "libvirt");
        activeGuestAttrs.put("active", "1");
    }
View Full Code Here

        when(idCertService.generateIdentityCert(any(Consumer.class)))
                .thenReturn(new IdentityCertificate());
        when(ownerCurator.lookupByKey(owner.getKey())).thenReturn(owner);
        when(complianceRules.getStatus(any(Consumer.class),
                any(Date.class), any(Boolean.class), any(Boolean.class)))
                .thenReturn(new ComplianceStatus(new Date()));
    }
View Full Code Here

        List<Consumer> consumers = uuids == null ? new LinkedList<Consumer>() :
            consumerCurator.findByUuids(uuids);
        Map<String, ComplianceStatus> results = new HashMap<String, ComplianceStatus>();

        for (Consumer consumer : consumers) {
            ComplianceStatus status = complianceRules.getStatus(consumer, null);
            results.put(consumer.getUuid(), status);
        }

        return results;
    }
View Full Code Here

        return results;
    }

    private void addDataToInstalledProducts(Consumer consumer) {

        ComplianceStatus complianceStatus = complianceRules.getStatus(
                           consumer, null, false);

        ConsumerInstalledProductEnricher enricher = new ConsumerInstalledProductEnricher(
            consumer, complianceStatus, complianceRules);
View Full Code Here

TOP

Related Classes of org.candlepin.policy.js.compliance.ComplianceStatus

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.