Search in sources :

Example 26 with ProductCachedSerializationModule

use of org.candlepin.jackson.ProductCachedSerializationModule in project candlepin by candlepin.

the class OverrideRulesTests method setupTest.

@Before
public void setupTest() {
    InputStream is = this.getClass().getResourceAsStream(RulesCurator.DEFAULT_RULES_FILE);
    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(productCurator)));
}
Also used : ProductCachedSerializationModule(org.candlepin.jackson.ProductCachedSerializationModule) InputStream(java.io.InputStream) JsRunnerProvider(org.candlepin.policy.js.JsRunnerProvider) RulesObjectMapper(org.candlepin.policy.js.RulesObjectMapper) Rules(org.candlepin.model.Rules) Date(java.util.Date) Before(org.junit.Before)

Aggregations

ProductCachedSerializationModule (org.candlepin.jackson.ProductCachedSerializationModule)26 Test (org.junit.Test)13 Before (org.junit.Before)12 PoolManager (org.candlepin.controller.PoolManager)10 Pool (org.candlepin.model.Pool)10 ActivationKey (org.candlepin.model.activationkeys.ActivationKey)10 ActivationKeyCurator (org.candlepin.model.activationkeys.ActivationKeyCurator)10 ActivationKeyPool (org.candlepin.model.activationkeys.ActivationKeyPool)10 RulesObjectMapper (org.candlepin.policy.js.RulesObjectMapper)10 StandardTranslator (org.candlepin.dto.StandardTranslator)9 Rules (org.candlepin.model.Rules)9 JsRunnerProvider (org.candlepin.policy.js.JsRunnerProvider)9 InputStream (java.io.InputStream)8 Date (java.util.Date)7 Owner (org.candlepin.model.Owner)5 ProductCurator (org.candlepin.model.ProductCurator)5 JsRunner (org.candlepin.policy.js.JsRunner)4 Locale (java.util.Locale)3 Consumer (org.candlepin.model.Consumer)3 HashSet (java.util.HashSet)2