TimeoutRepository { public static void setAllCalibrationTimeouts(HashMap<String, CalibrationTimeout> calibrationTimeouts) { Objects.requireNonNull(calibrationTimeouts, "The calibrationTimeouts can't be null.").values().forEach(TimeoutRepository::setTimeout); }  static Timeout getTimeout(String key); static void setTimeout(Timeout timeout); static void setAllCalibrationTimeouts(HashMap<String, CalibrationTimeout> calibrationTimeouts); static final Timeouts TIMEOUTS; }
@Test public void testSetAllCalibrationTimeouts() throws Exception { CalibrationTimeout timeout = new CalibrationTimeout("ode_v", "service", "", 20_000, 5_000); CalibrationTimeout timeoutTest = new CalibrationTimeout("bpelg_v", "service", "", 20_000, 5_000); HashMap<String, CalibrationTimeout> timeouts = new HashMap<>(); timeouts.put(timeout.getKey(), timeout); timeouts.put(timeout.getKey(), timeoutTest); TimeoutRepository.setAllCalibrationTimeouts(timeouts); assertEquals("The timeouts in ms should be equal.", timeout.getTimeoutInMs(), TimeoutRepository.getTimeout(timeout.getKey()).getTimeoutInMs()); assertEquals("The timeToRepetitions in ms should be equal.", timeout.getTimeToRepetitionInMs(), TimeoutRepository.getTimeout(timeout.getKey()).getTimeToRepetitionInMs()); assertEquals("The timeouts in ms should be equal.", timeoutTest.getTimeoutInMs(), TimeoutRepository.getTimeout(timeoutTest.getKey()).getTimeoutInMs()); assertEquals("The timeToRepetitions in ms should be equal.", timeoutTest.getTimeToRepetitionInMs(), TimeoutRepository.getTimeout(timeoutTest.getKey()).getTimeToRepetitionInMs()); }