use of org.candlepin.policy.EntitlementRefusedException in project candlepin by candlepin.
the class EntitlerTest method bindByProductErrorTest.
private void bindByProductErrorTest(String msg) throws Exception {
try {
String[] pids = { "prod1", "prod2", "prod3" };
Map<String, ValidationResult> fakeResult = new HashMap<>();
fakeResult.put("blah", fakeOutResult(msg));
EntitlementRefusedException ere = new EntitlementRefusedException(fakeResult);
AutobindData data = AutobindData.create(consumer, owner).forProducts(pids);
when(pm.entitleByProducts(data)).thenThrow(ere);
entitler.bindByProducts(data);
} catch (EntitlementRefusedException e) {
fail(msg + ": threw unexpected error");
}
}
Aggregations