AggregatorMessage { Set<SingleDeviceRequest> getDocumentEveryDevice(DeviceManagementProcessor processor) throws DispatchException { if (!containMountedMessage()) { return null; } Node managedDevices = getManagedDevicesNode(m_document); if (managedDevices == null) { return null; } NodeList devices = managedDevices.getChildNodes(); int nodeNum = devices.getLength(); Set<SingleDeviceRequest> singleDeviceRequests = new HashSet<>(); for (int id = 0; id < nodeNum; id++) { Node device = devices.item(id); SingleDeviceRequest singleDeviceRequest = buildOneDeviceRequest(processor, device); singleDeviceRequests.add(singleDeviceRequest); } return singleDeviceRequests; } private  AggregatorMessage();   AggregatorMessage(String netconfMessage); static NodeList getDeviceNodes(Document document); static Document stringToDocument(String request); @Override String toString(); static final String NS_OBBAA_NETWORK_MANAGER; }
@Test public void getDocumentEveryDeviceTest() throws Exception { when(m_deviceManagementProcessor.getDeviceTypeByDeviceName("deviceA")).thenReturn(""); when(m_deviceManagementProcessor.getDeviceTypeByDeviceName("deviceB")).thenReturn(""); Set<SingleDeviceRequest> requests = m_aggregatorMessage.getDocumentEveryDevice(m_deviceManagementProcessor); assertTrue(requests.size() == 2); }