SeyrenRepository { public void updateAlarm(final Alarm alarm) { alarm.setLastCheck(null); LOGGER.debug("Updating alarm {}", alarm.getId()); restTemplate.put(seyrenUrl + API_ALARMS + "/" + alarm.getId(), alarm, String.class); }  void setRestTemplate(final RestTemplate restTemplate); void setSeyrenUrl(final String seyrenUrl); Alarm getAlarm(final String id); Alarm.Alarms getAllAlarms(); void addAlarm(final Alarm alarm); void updateAlarm(final Alarm alarm); boolean deleteAlarm(final String alarmId); void addSubscription(final Subscription subscription, final String alarmId); void updateSubscription(final Subscription subscription, final String alarmId); boolean deleteSubscription(final String alarmId, final String subscriptionId); Alert.Alerts getAlerts(final int start, final int items); Alert.Alerts getAlarmAlerts(final String alarmId, final int start, final int items); static final String API_ALARMS; static final String API_ALERTS; }
@Test public void testUpdateAlarm() { Alarm alarm = TestUtils.getDefaultAlarm(); doNothing().when(restTemplate).put(anyString(), anyObject(), any(String.class)); repository.updateAlarm(alarm); verify(restTemplate).put(DEFAULT_SEYREN_URL + SeyrenRepository.API_ALARMS+"/"+alarm.getId(), alarm, String.class); }