RulesCurator extends AbstractHibernateCurator<Rules> { public Rules getRules() { Rules dbRules = getDbRules(); if (dbRules == null) { log.error("There is no rules file in the database, something is very wrong."); throw new NotFoundException(i18nProvider.get().tr("No rules file found in the database")); } return dbRules; } RulesCurator(); @Transactional Rules update(Rules updatedRules); @Override @Transactional Rules create(Rules toCreate); Rules getDbRules(); void updateDbRules(); Rules getRules(); Date getUpdatedFromDB(); Date getUpdated(); @Transactional void resetToRpmRules(); @Override @Transactional void delete(Rules toDelete); static final String DEFAULT_RULES_FILE; static final int RULES_API_VERSION; }
@Test public void noForEachInRules() throws Exception { Rules rules = rulesCurator.getRules(); assertEquals(-1, rules.getRules().indexOf("for each")); }
@Test public void getRules() { rulesCurator.getRules(); }