@Test
public void searchAlarmsBySubscriptionTarget() throws Exception {

    Subscription notDefaultTargetSubscription = TestUtils.getDefaultSubscription();
    notDefaultTargetSubscription.setTarget("supercoucou");
    Alarm alarm1 = TestUtils.getDefaultAlarm();
    Alarm alarm2 = TestUtils.getDefaultAlarm();
    Alarm alarmWithoutDefaultTargetSubscription = TestUtils.getDefaultAlarm();
    alarmWithoutDefaultTargetSubscription.setSubscriptions(asList(notDefaultTargetSubscription));
    Alarm.Alarms alarms = new Alarm.Alarms();
    alarms.setValues(asList(alarm1, alarmWithoutDefaultTargetSubscription, alarm2));
    reset(seyrenRepository);
    when(seyrenRepository.getAllAlarms()).thenReturn(alarms);
    Collection<Alarm> resultAlarms = alarmService.searchAlarmsBySubscriptionTarget(TestUtils.DEFAULT_EMAIL);
    assertThat(resultAlarms).containsOnly(alarm1, alarm2);
}