@Test
public void testClearAlarmsOnNodeAndSubtree() {

    Timestamp timestamp = new Timestamp(System.currentTimeMillis());
    createAlarms(timestamp, 1);
    m_persistenceManager.getEntityDataStoreManager().beginTransaction();
    List<Alarm> alarms = getAlarmsFor(0, 1);
    assertEquals(1, alarms.size());
    m_alarmService.clearAlarmsOnNodeAndSubtree(MODEL_NODE_ID, MOUNT_KEY);
    m_alarmQueue.clearQueue();
    alarms = getAlarmsFor(0, 1);
    m_persistenceManager.getEntityDataStoreManager().commitTransaction();
    assertEquals(0, alarms.size());
    // verify send notification is called
    verify(m_notificationService, times(1)).sendNotification(eq(AlarmConstants.ALARM_STREAM_NAME), any(DefaultAlarmStateChangeNotification.class));
    // verify the notification
    DefaultAlarmStateChangeNotification notification = m_internalAlarmService.getNotification();
    ModelNodeDataStoreManager actualDsm = notification.getModelNodeDSM();
    assertNotNull(actualDsm);
    assertEquals(m_dsm, actualDsm);
    AlarmNotification alarmNotification = notification.getAlarmNotification();
    assertEquals(AlarmCondition.ALARM_OFF, alarmNotification.getAlarmCondition());
    destroyAlarms();
}