test_class.declarator: DEFAULT_SEYREN_URL = "coucou"
test_class.modifier: private static final
test_class.original_string: private static final String DEFAULT_SEYREN_URL = "coucou";
test_class.type: String
test_class.var_name: DEFAULT_SEYREN_URL
test_class.declarator: repository = new SeyrenRepository()
test_class.modifier: @InjectMocks
      private final
test_class.original_string: @InjectMocks
      private final SeyrenRepository repository = new SeyrenRepository();
test_class.type: SeyrenRepository
test_class.var_name: repository
test_class.declarator: restTemplate
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private RestTemplate restTemplate;
test_class.type: RestTemplate
test_class.var_name: restTemplate
test_class.file: services/src/test/java/com/vsct/supervision/notification/repository/SeyrenRepositoryTest.java
test_class.identifier: SeyrenRepositoryTest
test_case.body: @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);
      }
test_case.class_method_signature: SeyrenRepositoryTest.testUpdateAlarm()
test_case.full_signature: @Test public void testUpdateAlarm()
test_case.identifier: testUpdateAlarm
test_case.invocations: getDefaultAlarm put when doNothing anyString anyObject any updateAlarm put verify getId
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testUpdateAlarm()
focal_class.declarator: API_ALARMS = "/api/checks"
focal_class.modifier: public static final
focal_class.original_string: public static final String API_ALARMS = "/api/checks";
focal_class.type: String
focal_class.var_name: API_ALARMS
focal_class.declarator: API_ALERTS = "/api/alerts"
focal_class.modifier: public static final
focal_class.original_string: public static final String API_ALERTS = "/api/alerts";
focal_class.type: String
focal_class.var_name: API_ALERTS
focal_class.declarator: LOGGER = LoggerFactory.getLogger(SeyrenRepository.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(SeyrenRepository.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: restTemplate
focal_class.modifier: @Autowired
      protected
focal_class.original_string: @Autowired
      protected RestTemplate restTemplate;
focal_class.type: RestTemplate
focal_class.var_name: restTemplate
focal_class.declarator: seyrenUrl
focal_class.modifier: @Value("${seyren.host}")
      protected
focal_class.original_string: @Value("${seyren.host}")
      protected String seyrenUrl;
focal_class.type: String
focal_class.var_name: seyrenUrl
focal_class.file: services/src/main/java/com/vsct/supervision/notification/repository/SeyrenRepository.java
focal_class.identifier: SeyrenRepository
focal_class.class_method_signature: SeyrenRepository.setRestTemplate(final RestTemplate restTemplate)
focal_class.full_signature: public void setRestTemplate(final RestTemplate restTemplate)
focal_class.identifier: setRestTemplate
focal_class.modifiers: public
focal_class.parameters: (final RestTemplate restTemplate)
focal_class.return: void
focal_class.signature: void setRestTemplate(final RestTemplate restTemplate)
focal_class.class_method_signature: SeyrenRepository.setSeyrenUrl(final String seyrenUrl)
focal_class.full_signature: public void setSeyrenUrl(final String seyrenUrl)
focal_class.identifier: setSeyrenUrl
focal_class.modifiers: public
focal_class.parameters: (final String seyrenUrl)
focal_class.return: void
focal_class.signature: void setSeyrenUrl(final String seyrenUrl)
focal_class.class_method_signature: SeyrenRepository.getAlarm(final String id)
focal_class.full_signature: public Alarm getAlarm(final String id)
focal_class.identifier: getAlarm
focal_class.modifiers: public
focal_class.parameters: (final String id)
focal_class.return: Alarm
focal_class.signature: Alarm getAlarm(final String id)
focal_class.class_method_signature: SeyrenRepository.getAllAlarms()
focal_class.full_signature: public Alarm.Alarms getAllAlarms()
focal_class.identifier: getAllAlarms
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Alarm.Alarms
focal_class.signature: Alarm.Alarms getAllAlarms()
focal_class.class_method_signature: SeyrenRepository.addAlarm(final Alarm alarm)
focal_class.full_signature: public void addAlarm(final Alarm alarm)
focal_class.identifier: addAlarm
focal_class.modifiers: public
focal_class.parameters: (final Alarm alarm)
focal_class.return: void
focal_class.signature: void addAlarm(final Alarm alarm)
focal_class.class_method_signature: SeyrenRepository.updateAlarm(final Alarm alarm)
focal_class.full_signature: public void updateAlarm(final Alarm alarm)
focal_class.identifier: updateAlarm
focal_class.modifiers: public
focal_class.parameters: (final Alarm alarm)
focal_class.return: void
focal_class.signature: void updateAlarm(final Alarm alarm)
focal_class.class_method_signature: SeyrenRepository.deleteAlarm(final String alarmId)
focal_class.full_signature: public boolean deleteAlarm(final String alarmId)
focal_class.identifier: deleteAlarm
focal_class.modifiers: public
focal_class.parameters: (final String alarmId)
focal_class.return: boolean
focal_class.signature: boolean deleteAlarm(final String alarmId)
focal_class.class_method_signature: SeyrenRepository.addSubscription(final Subscription subscription, final String alarmId)
focal_class.full_signature: public void addSubscription(final Subscription subscription, final String alarmId)
focal_class.identifier: addSubscription
focal_class.modifiers: public
focal_class.parameters: (final Subscription subscription, final String alarmId)
focal_class.return: void
focal_class.signature: void addSubscription(final Subscription subscription, final String alarmId)
focal_class.class_method_signature: SeyrenRepository.updateSubscription(final Subscription subscription, final String alarmId)
focal_class.full_signature: public void updateSubscription(final Subscription subscription, final String alarmId)
focal_class.identifier: updateSubscription
focal_class.modifiers: public
focal_class.parameters: (final Subscription subscription, final String alarmId)
focal_class.return: void
focal_class.signature: void updateSubscription(final Subscription subscription, final String alarmId)
focal_class.class_method_signature: SeyrenRepository.deleteSubscription(final String alarmId, final String subscriptionId)
focal_class.full_signature: public boolean deleteSubscription(final String alarmId, final String subscriptionId)
focal_class.identifier: deleteSubscription
focal_class.modifiers: public
focal_class.parameters: (final String alarmId, final String subscriptionId)
focal_class.return: boolean
focal_class.signature: boolean deleteSubscription(final String alarmId, final String subscriptionId)
focal_class.class_method_signature: SeyrenRepository.getAlerts(final int start, final int items)
focal_class.full_signature: public Alert.Alerts getAlerts(final int start, final int items)
focal_class.identifier: getAlerts
focal_class.modifiers: public
focal_class.parameters: (final int start, final int items)
focal_class.return: Alert.Alerts
focal_class.signature: Alert.Alerts getAlerts(final int start, final int items)
focal_class.class_method_signature: SeyrenRepository.getAlarmAlerts(final String alarmId, final int start, final int items)
focal_class.full_signature: public Alert.Alerts getAlarmAlerts(final String alarmId, final int start, final int items)
focal_class.identifier: getAlarmAlerts
focal_class.modifiers: public
focal_class.parameters: (final String alarmId, final int start, final int items)
focal_class.return: Alert.Alerts
focal_class.signature: Alert.Alerts getAlarmAlerts(final String alarmId, final int start, final int items)
focal_method.body: public void updateAlarm(final Alarm alarm) {
  
          // TODO : serialize/deserialize java 8 java.time with Jackson JSON mapper
          // com.fasterxml.jackson.databind.JsonMappingException: Can not instantiate value of type [simple type, class org.joda.time.DateTime] from Floating-point number (1.467041095011E9); // NOSONAR
          // no one-double/Double-arg constructor/factory method at [Source: org.apache.catalina.connector.CoyoteInputStream@22c7305d; line:
          // 14, column: 16] (through reference chain: com.seyren.core.domain.Alarm["lastAlarm"])
          alarm.setLastCheck(null);
  
          LOGGER.debug("Updating alarm {}", alarm.getId());
          restTemplate.put(seyrenUrl + API_ALARMS + "/" + alarm.getId(), alarm, String.class);
      }
focal_method.class_method_signature: SeyrenRepository.updateAlarm(final Alarm alarm)
focal_method.full_signature: public void updateAlarm(final Alarm alarm)
focal_method.identifier: updateAlarm
focal_method.invocations: setLastCheck debug getId put getId
focal_method.modifiers: public
focal_method.parameters: (final Alarm alarm)
focal_method.return: void
focal_method.signature: void updateAlarm(final Alarm alarm)