@Test
public void testDeviceDisConnected() throws NetconfMessageBuilderException, IOException, SAXException {

    Device device = new Device();
    device.setDeviceName("testDeviceOFF");
    NetconfClientSession clientSession = mock(NetconfClientSession.class);
    m_listener.deviceDisConnected(device, clientSession);
    ArgumentCaptor<Notification> captor = ArgumentCaptor.forClass(Notification.class);
    verify(m_notificationService, times(1)).sendNotification(eq("STATE_CHANGE"), captor.capture());
    Notification notification = captor.getValue();
    String expectedNotifElem = "<network-manager xmlns=\"urn:bbf:yang:obbaa:network-manager\">\n" +
            "<managed-devices>\n" +
            "<device>\n" +
            "<name>testDeviceOFF</name>\n" +
            "<device-notification>\n" +
            "<device-state-change>\n" +
            "<event>offline</event>\n" +
            "</device-state-change>\n" +
            "</device-notification>\n" +
            "</device>\n" +
            "</managed-devices>\n" +
            "</network-manager>\n";
      assertEquals(expectedNotifElem, DocumentUtils.documentToPrettyString(notification.getNotificationElement()));
    TestUtil.assertXMLEquals(DocumentUtils.stringToDocument(expectedNotifElem).getDocumentElement(),
            notification.getNotificationElement());
}