@Override
    public DeviceDescription discoverDeviceDetails() {
        log.debug("Adding description for Waveserver Ai device");

        NetconfSession session = getNetconfSession();
        Device device = getDevice(handler().data().deviceId());

        try {
            XPath xp = XPathFactory.newInstance().newXPath();

            Node node = TEMPLATE_MANAGER.doRequest(session, "discoverDeviceDetails");
            String chassisId = xp.evaluate("waveserver-chassis/mac-addresses/chassis/base/text()", node);
            chassisId = chassisId.replace(":", "");
            SparseAnnotations annotationDevice = DefaultAnnotations.builder()
                    .set("name", xp.evaluate("waveserver-system/host-name/current-host-name/text()", node))
                    .build();
            return new DefaultDeviceDescription(device.id().uri(),
                                                Device.Type.OTN,
                                                "Ciena",
                                                "WaverserverAi",
                                                xp.evaluate("waveserver-software/status/active-version/text()",
                                                            node),
                                                xp.evaluate("waveserver-chassis/identification/serial-number/text()",
                                                            node),
                                                new ChassisId(Long.valueOf(chassisId, 16)),
                                                (SparseAnnotations) annotationDevice);
        } catch (NetconfException | XPathExpressionException e) {
            log.error("Unable to retrieve device information for device {}, {}", device.chassisId(), e);
        }

        return new DefaultDeviceDescription(device.id().uri(), Device.Type.OTN, "Ciena", "WaverserverAi", "unknown",
                                            "unknown", device.chassisId());
    }
@Test
    public void testDiscoverDeviceDetails() {
        XPath xp = XPathFactory.newInstance().newXPath();

        SparseAnnotations expectAnnotation = DefaultAnnotations.builder()
                .set("hostname", "hostnameWaveServer")
                .build();
        DefaultDeviceDescription expectResult = new DefaultDeviceDescription(
               mockDeviceId.uri(),
               Device.Type.OTN,
               "Ciena",
               "WaverserverAi",
               "waveserver-1.1.0.302",
               "M000",
               new ChassisId(0L),
               expectAnnotation);

        try {
            Node node = doRequest("/response/discoverDeviceDetails.xml", "/rpc-reply/data");

            SparseAnnotations annotationDevice = DefaultAnnotations.builder()
                    .set("hostname", xp.evaluate("waveserver-system/host-name/current-host-name/text()", node))
                    .build();

            DefaultDeviceDescription result = new DefaultDeviceDescription(
                     mockDeviceId.uri(),
                     Device.Type.OTN,
                     "Ciena",
                     "WaverserverAi",
                     xp.evaluate("waveserver-software/status/active-version/text()", node),
                     xp.evaluate("waveserver-chassis/identification/serial-number/text()", node),
                     new ChassisId(0L),
                     annotationDevice);
            assertEquals(expectResult, result);

        } catch (XPathExpressionException e) {
            e.printStackTrace();
        }
    }