@Test
public void testOnDeploy() throws URISyntaxException {

    SchemaRegistryImpl mountRegistry = mock(SchemaRegistryImpl.class);
    Module module = mock(Module.class);
    String alarmNS = "urn:ietf:params:xml:ns:yang:ietf-alarms";
    String alarmNotification = "alarm-notification";
    String moduleCapabilityString = "urn:ietf:params:xml:ns:yang:ietf-alarms?module=ietf-alarms&revision=2019-09-11";
    QName alarmNotificationQName = QName.create(alarmNS, alarmNotification);
    QNameModule qNameModule = QNameModule.create(new URI("urn:ietf:params:xml:ns:yang:ietf-alarms"), Revision.of("2019-09-11"));
    when(module.getNamespace()).thenReturn(new URI(alarmNS));
    when(module.getName()).thenReturn("ietf-alarms");
    when(module.getQNameModule()).thenReturn(qNameModule);
    when(mountRegistry.getModuleByNamespace(alarmNS)).thenReturn(module);
    when(m_adapter.getDeviceAdapterId()).thenReturn(m_deviceAdapterId);
    when(m_adapterManager.getAdapterContext(m_deviceAdapterId)).thenReturn(m_adapterContext);
    when(m_notificationService.isNotificationCallbackRegistered(alarmNotificationQName, moduleCapabilityString)).thenReturn(false);
    when(m_adapterContext.getSchemaRegistry()).thenReturn(mountRegistry);
    AlarmManagementCallbackRegistrator registrator = new AlarmManagementCallbackRegistrator(m_notificationService, m_alarmService, null);
    @SuppressWarnings({"rawtypes", "unchecked"})
    Class<List<NotificationCallBackInfo>> listClass = (Class<List<NotificationCallBackInfo>>) (Class) List.class;
    ArgumentCaptor<List<NotificationCallBackInfo>> capture = ArgumentCaptor.forClass(listClass);
    registrator.onDeployed(m_adapter, m_adapterContext);
    verify(m_notificationService).registerCallBack(capture.capture());
    List<NotificationCallBackInfo> callbacks = capture.getValue();
    assertEquals(alarmNotificationQName, callbacks.get(0).getNotificationTypes().iterator().next());
}