use of org.candlepin.policy.js.override.OverrideRules in project candlepin by candlepin.
the class ContentOverrideValidatorTest method setupTest.
@Before
public void setupTest() {
InputStream is = this.getClass().getResourceAsStream(RulesCurator.DEFAULT_RULES_FILE);
rulesCuratorMock = mock(RulesCurator.class);
config = mock(Configuration.class);
cacheProvider = mock(Provider.class);
cache = mock(JsRunnerRequestCache.class);
Rules rules = new Rules(Util.readFile(is));
when(rulesCuratorMock.getUpdated()).thenReturn(new Date());
when(rulesCuratorMock.getRules()).thenReturn(rules);
when(cacheProvider.get()).thenReturn(cache);
provider = new JsRunnerProvider(rulesCuratorMock, cacheProvider);
overrideRules = new OverrideRules(provider.get(), config, new RulesObjectMapper(new ProductCachedSerializationModule(mockProductCurator)));
validator = new ContentOverrideValidator(i18n, overrideRules);
}
Aggregations