use of org.candlepin.policy.ValidationResult in project candlepin by candlepin.
the class PreEntitlementRulesTest method userRestrictedPoolFailsPre.
@Test
public void userRestrictedPoolFailsPre() {
Pool pool = setupUserRestrictedPool();
consumer.setUsername("notbob");
ValidationResult result = enforcer.preEntitlement(consumer, pool, 1);
assertTrue(result.hasErrors());
assertFalse(result.hasWarnings());
}
use of org.candlepin.policy.ValidationResult in project candlepin by candlepin.
the class PreEntitlementRulesTest method devPoolConsumerMatches.
@Test
public void devPoolConsumerMatches() {
Pool pool = setupDevConsumerRestrictedPool(consumer);
ValidationResult result = enforcer.preEntitlement(consumer, pool, 1);
assertFalse(result.hasErrors());
assertFalse(result.hasWarnings());
}
use of org.candlepin.policy.ValidationResult in project candlepin by candlepin.
the class PreEntitlementRulesTest method testDuplicateArchesMatches.
@Test
public void testDuplicateArchesMatches() {
Pool pool = setupArchTest("arch", "x86_64,x86_64", "uname.machine", "x86_64");
ValidationResult result = enforcer.preEntitlement(consumer, pool, 1);
assertFalse(result.hasErrors());
assertFalse(result.hasWarnings());
}
use of org.candlepin.policy.ValidationResult in project candlepin by candlepin.
the class PreEntitlementRulesTest method correctConsumerTypeShouldNotGenerateError.
@Test
public void correctConsumerTypeShouldNotGenerateError() {
ConsumerType ctype = this.mockConsumerType(new ConsumerType(ConsumerTypeEnum.DOMAIN));
Pool pool = setupProductWithConsumerTypeAttribute(ConsumerTypeEnum.DOMAIN);
consumer.setType(ctype);
ValidationResult result = enforcer.preEntitlement(consumer, pool, 1);
assertFalse(result.hasErrors());
assertFalse(result.hasWarnings());
}
use of org.candlepin.policy.ValidationResult in project candlepin by candlepin.
the class PreEntitlementRulesTest method x86ArchitectureProvidesI386.
@Test
public void x86ArchitectureProvidesI386() {
Pool pool = setupArchTest("arch", "x86", "uname.machine", "i386");
ValidationResult result = enforcer.preEntitlement(consumer, pool, 1);
assertFalse(result.hasErrors());
assertFalse(result.hasWarnings());
}
Aggregations