use of org.candlepin.model.ConsumerCapability in project candlepin by candlepin.
the class ManifestEntitlementRulesTest method preEntitlementWithDerivedProductCapabilitySuccessOnBind.
@Test
public void preEntitlementWithDerivedProductCapabilitySuccessOnBind() {
Consumer c = this.createMockConsumer(true);
HashSet<ConsumerCapability> capabilities = new HashSet<>();
capabilities.add(new ConsumerCapability(c, "derived_product"));
c.setCapabilities(capabilities);
Product prod = TestUtil.createProduct();
Product derived = TestUtil.createProduct("sub-prod-id");
Pool p = TestUtil.createPool(prod);
p.setDerivedProduct(derived);
ValidationResult results = enforcer.preEntitlement(c, p, 1, CallerType.BIND);
assertNotNull(results);
assertTrue("Expected no warnings or errors.", results.isSuccessful());
}
Aggregations