@Test
public void testDeploymentOfSamePlugTwice() throws Exception {

    ArgumentCaptor<List> infoCaptor = ArgumentCaptor.forClass(List.class);
    NotificationContext context = new NotificationContext();
    // Here m_deviceAdapter refers to adapter 1
    // deploy adapter 1
    m_registry.buildSchemaContext(getYangFiles(), Collections.emptySet(), Collections.emptyMap());
    AlarmService alarmService = new AlarmServiceImpl(mock(PersistenceManagerUtil.class), mock(AlarmQueue.class));
    m_standardModelRegistrator = new StandardModelRegistrator(m_notificationService, alarmService, m_registry);
    m_standardModelRegistrator.onDeployed(m_deviceAdapter, m_adapterContext);
    verify(m_notificationService, times(1)).registerCallBack(infoCaptor.capture());
    NotificationCallBackInfo callbackInfo1 = (NotificationCallBackInfo) infoCaptor.getValue().get(0);
    context.put(DeviceAdapterId.class.getSimpleName(), m_deviceAdapterId);
    assertTrue(callbackInfo1.getNotificationApplicableCheck().isApplicable(context));
    List<NotificationCallBackInfo> notificationCallBackInfos = new ArrayList<>();
    notificationCallBackInfos.add(callbackInfo1);
    when(m_notificationService.getNotificationCallBacks()).thenReturn(notificationCallBackInfos);
    // deploy adapter 1 again
    List<YangTextSchemaSource> yangFiles = getYangFiles();
    //yangFiles.add(m_ietfAlarm1Yang);
    m_registry.buildSchemaContext(yangFiles, Collections.emptySet(), Collections.emptyMap());
    m_standardModelRegistrator.onDeployed(m_deviceAdapter, m_adapterContext);
    // registerCallBack should not be called again , count should remain 1
    // only
    verify(m_notificationService, times(1)).registerCallBack(infoCaptor.capture());
}