test_class.declarator: alarmService = new AlarmService()
test_class.modifier: @InjectMocks
      private final
test_class.original_string: @InjectMocks
      private final AlarmService alarmService = new AlarmService();
test_class.type: AlarmService
test_class.var_name: alarmService
test_class.declarator: subscriptionService
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private SubscriptionService subscriptionService;
test_class.type: SubscriptionService
test_class.var_name: subscriptionService
test_class.declarator: seyrenRepository
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private SeyrenRepository seyrenRepository;
test_class.type: SeyrenRepository
test_class.var_name: seyrenRepository
test_class.declarator: notificationHandler
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private NotificationHandler notificationHandler;
test_class.type: NotificationHandler
test_class.var_name: notificationHandler
test_class.file: services/src/test/java/com/vsct/supervision/notification/service/AlarmServiceTest.java
test_class.identifier: AlarmServiceTest
test_case.body: @Test
      public void disableAlarmSendDeactivationEmail(){
          Alarm alarm = TestUtils.getDefaultAlarm();
          alarmService.updateAlarm(alarm);
          verify(notificationHandler).sendAlarmHasBeenDeactivated(alarm);
      }
test_case.class_method_signature: AlarmServiceTest.disableAlarmSendDeactivationEmail()
test_case.full_signature: @Test public void disableAlarmSendDeactivationEmail()
test_case.identifier: disableAlarmSendDeactivationEmail
test_case.invocations: getDefaultAlarm updateAlarm sendAlarmHasBeenDeactivated verify
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void disableAlarmSendDeactivationEmail()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(AlarmService.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(AlarmService.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: seyrenRepository
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private SeyrenRepository seyrenRepository;
focal_class.type: SeyrenRepository
focal_class.var_name: seyrenRepository
focal_class.declarator: subscriptionService
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private SubscriptionService subscriptionService;
focal_class.type: SubscriptionService
focal_class.var_name: subscriptionService
focal_class.declarator: notificationHandler
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private NotificationHandler notificationHandler;
focal_class.type: NotificationHandler
focal_class.var_name: notificationHandler
focal_class.file: services/src/main/java/com/vsct/supervision/notification/service/AlarmService.java
focal_class.identifier: AlarmService
focal_class.class_method_signature: AlarmService.getAlarm(String id)
focal_class.full_signature: public Alarm getAlarm(String id)
focal_class.identifier: getAlarm
focal_class.modifiers: public
focal_class.parameters: (String id)
focal_class.return: Alarm
focal_class.signature: Alarm getAlarm(String id)
focal_class.class_method_signature: AlarmService.getAllAlarms()
focal_class.full_signature: public Collection<Alarm> getAllAlarms()
focal_class.identifier: getAllAlarms
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Collection<Alarm>
focal_class.signature: Collection<Alarm> getAllAlarms()
focal_class.class_method_signature: AlarmService.subscribeToAAlarm(final Alarm alarm)
focal_class.full_signature: public Alarm subscribeToAAlarm(final Alarm alarm)
focal_class.identifier: subscribeToAAlarm
focal_class.modifiers: public
focal_class.parameters: (final Alarm alarm)
focal_class.return: Alarm
focal_class.signature: Alarm subscribeToAAlarm(final Alarm alarm)
focal_class.class_method_signature: AlarmService.activateAlarm(final Alarm alarm)
focal_class.full_signature: private void activateAlarm(final Alarm alarm)
focal_class.identifier: activateAlarm
focal_class.modifiers: private
focal_class.parameters: (final Alarm alarm)
focal_class.return: void
focal_class.signature: void activateAlarm(final Alarm alarm)
focal_class.class_method_signature: AlarmService.searchAlarmByName(final String name)
focal_class.full_signature: private Alarm searchAlarmByName(final String name)
focal_class.identifier: searchAlarmByName
focal_class.modifiers: private
focal_class.parameters: (final String name)
focal_class.return: Alarm
focal_class.signature: Alarm searchAlarmByName(final String name)
focal_class.class_method_signature: AlarmService.searchAlarmsBySourceTargetAndThresholds(final URI source, final String target, final BigDecimal warn,
          final BigDecimal error)
focal_class.full_signature: private Collection<Alarm> searchAlarmsBySourceTargetAndThresholds(final URI source, final String target, final BigDecimal warn,
          final BigDecimal error)
focal_class.identifier: searchAlarmsBySourceTargetAndThresholds
focal_class.modifiers: private
focal_class.parameters: (final URI source, final String target, final BigDecimal warn,
          final BigDecimal error)
focal_class.return: Collection<Alarm>
focal_class.signature: Collection<Alarm> searchAlarmsBySourceTargetAndThresholds(final URI source, final String target, final BigDecimal warn,
          final BigDecimal error)
focal_class.class_method_signature: AlarmService.searchAlarm(final Alarm alarm)
focal_class.full_signature: public Alarm searchAlarm(final Alarm alarm)
focal_class.identifier: searchAlarm
focal_class.modifiers: public
focal_class.parameters: (final Alarm alarm)
focal_class.return: Alarm
focal_class.signature: Alarm searchAlarm(final Alarm alarm)
focal_class.class_method_signature: AlarmService.searchAlarmsBySubscriptionTarget(String subTarget)
focal_class.full_signature: public Collection<Alarm> searchAlarmsBySubscriptionTarget(String subTarget)
focal_class.identifier: searchAlarmsBySubscriptionTarget
focal_class.modifiers: public
focal_class.parameters: (String subTarget)
focal_class.return: Collection<Alarm>
focal_class.signature: Collection<Alarm> searchAlarmsBySubscriptionTarget(String subTarget)
focal_class.class_method_signature: AlarmService.updateAlarm(final Alarm alarm)
focal_class.full_signature: public Alarm updateAlarm(final Alarm alarm)
focal_class.identifier: updateAlarm
focal_class.modifiers: public
focal_class.parameters: (final Alarm alarm)
focal_class.return: Alarm
focal_class.signature: Alarm updateAlarm(final Alarm alarm)
focal_class.class_method_signature: AlarmService.validateUpdatable(Alarm alarm)
focal_class.full_signature: private void validateUpdatable(Alarm alarm)
focal_class.identifier: validateUpdatable
focal_class.modifiers: private
focal_class.parameters: (Alarm alarm)
focal_class.return: void
focal_class.signature: void validateUpdatable(Alarm alarm)
focal_method.body: public Alarm updateAlarm(final Alarm alarm) {
          LOGGER.debug("Update alarm to: " + alarm);
  
          validateUpdatable(alarm);
  
          try {
              seyrenRepository.updateAlarm(alarm);
  
              if(alarm.isEnabled()) {
                  notificationHandler.sendAlarmHasBeenModified(alarm);
              } else{
                  notificationHandler.sendAlarmHasBeenDeactivated(alarm);
              }
  
              return this.searchAlarmByName(alarm.getName());
          } catch (RuntimeException exception) {
              LOGGER.error("Error updating alarm", exception);
              throw new CerebroException(ErrorCode.CEREBRO_UNKNOWN_ERROR, "Error updating alarm", exception);
          }
      }
focal_method.class_method_signature: AlarmService.updateAlarm(final Alarm alarm)
focal_method.full_signature: public Alarm updateAlarm(final Alarm alarm)
focal_method.identifier: updateAlarm
focal_method.invocations: debug validateUpdatable updateAlarm isEnabled sendAlarmHasBeenModified sendAlarmHasBeenDeactivated searchAlarmByName getName error
focal_method.modifiers: public
focal_method.parameters: (final Alarm alarm)
focal_method.return: Alarm
focal_method.signature: Alarm updateAlarm(final Alarm alarm)