AlertDefinitionsCache { public void setAlertsMapById(Map<BigInteger, Alert> alertsMapById) { this.alertsMapById = alertsMapById; } AlertDefinitionsCache(AlertService alertService);  AlertDefinitionsCache(AlertService alertService, boolean refreshThreadDaemonized);  AlertDefinitionsCache(AlertDefinitionsCacheRefresherThread refresherThread); Map<BigInteger, Alert> getAlertsMapById(); void setAlertsMapById(Map<BigInteger, Alert> alertsMapById); Map<String, List<BigInteger>> getAlertsMapByCronEntry(); void setAlertsMapByCronEntry(Map<String, List<BigInteger>> alertsMapByCronEntry); boolean isAlertsCacheInitialized(); void setAlertsCacheInitialized(boolean alertsCacheInitialized); static List<Alert> getEnabledAlertsForMinute(long minuteStartTimeMillis);  }
@Test public void testSetAlertsMapById(){ Map<BigInteger, Alert> alertMapById = new HashMap<>(); Alert alert1 = new Alert(userService.findAdminUser(), admin, "testAlert1", "COUNT(-1h:scope:metric:avg, -1h:scope:metric:avg, -1h:scope:metric:avg)", "* * * * *"); alertMapById.put(new BigInteger("1"), alert1); Alert alert2 = new Alert(userService.findAdminUser(), admin, "testAlert2", "COUNT(-1h:scope:metric:avg, -1h:scope:metric:avg, -1h:scope:metric:avg)", "* * * * *"); alertMapById.put(new BigInteger("2"), alert2); alertDefinitionsCache.setAlertsMapById(alertMapById); assertTrue(alertDefinitionsCache.getAlertsMapById() == alertMapById); }