use of org.candlepin.policy.js.compliance.StatusReasonMessageGenerator in project candlepin by candlepin.
the class InstalledProductStatusCalculatorTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
translator = new StandardTranslator(this.consumerTypeCurator, this.environmentCurator, this.ownerCurator);
// Load the default production rules:
InputStream is = this.getClass().getResourceAsStream(RulesCurator.DEFAULT_RULES_FILE);
Rules rules = new Rules(Util.readFile(is));
Locale locale = new Locale("en_US");
when(rulesCuratorMock.getUpdated()).thenReturn(new Date());
when(rulesCuratorMock.getRules()).thenReturn(rules);
when(cacheProvider.get()).thenReturn(cache);
this.provider = new JsRunnerProvider(rulesCuratorMock, cacheProvider);
i18n = I18nFactory.getI18n(getClass(), "org.candlepin.i18n.Messages", locale, I18nFactory.FALLBACK);
RulesObjectMapper objectMapper = new RulesObjectMapper(new ProductCachedSerializationModule(productCurator));
this.complianceRules = new ComplianceRules(provider.get(), this.entCurator, new StatusReasonMessageGenerator(i18n), eventSink, this.consumerCurator, this.consumerTypeCurator, objectMapper, translator);
this.consumerEnricher = new ConsumerEnricher(this.complianceRules, this.ownerProductCurator);
}
Aggregations