@Test
public void deleteTheOnlyOneSubscriptionForAAlarm() throws Exception {

    when(seyrenRepository.deleteSubscription(TestUtils.DEFAULT_ALARM_ID, TestUtils.DEFAULT_SUBSCRIPTION_ID)).thenReturn(true);
    // Remove subscription to alarm for mock
    Alarm c = TestUtils.getDefaultAlarm();
    c.setSubscriptions(new ArrayList<>());
    assertTrue(c.getSubscriptions().isEmpty());
    when(seyrenRepository.getAlarm(TestUtils.DEFAULT_ALARM_ID)).thenReturn(c);
    when(seyrenRepository.deleteAlarm(TestUtils.DEFAULT_ALARM_ID)).thenReturn(true);
    assertEquals(SubscriptionService.DeletedSubscriptionStatus.ALARM_DELETED,
        subscriptionService.deleteSubscription(TestUtils.DEFAULT_ALARM_ID, TestUtils.DEFAULT_SUBSCRIPTION_ID));
    verify(seyrenRepository).deleteSubscription(TestUtils.DEFAULT_ALARM_ID, TestUtils.DEFAULT_SUBSCRIPTION_ID);
    verify(seyrenRepository).getAlarm(TestUtils.DEFAULT_ALARM_ID);
    verify(seyrenRepository).deleteAlarm(TestUtils.DEFAULT_ALARM_ID);
    verifyNoMoreInteractions(seyrenRepository);
}