StandbyNodeServiceImpl extends AbstractService implements StandbyNodeService { @Override public List<StandbyNodeView> getAllNodes() { List<StandbyNodeData> standbyNodeDataList; List<StandbyNodeView> standbyNodeViewList = new ArrayList<>(); try { standbyNodeDataList = standbyApiFactory.nodeApi().getAllNodes(); } catch (Exception e) { LoggerHelper.warn("select all standby nodes failed, has been ignored [" + e.getClass().getName() + ", " + e.getMessage() + "]"); return standbyNodeViewList; } for (StandbyNodeData standbyNodeData : standbyNodeDataList) { StandbyNodeView standbyNodeView = new StandbyNodeView(); standbyNodeView.setId(standbyNodeData.getId()); if (standbyNodeData.getData() != null) { ReflectHelper.copyFieldValues(standbyNodeData.getData(), standbyNodeView); } standbyNodeViewList.add(standbyNodeView); } return standbyNodeViewList; }  @Override List<StandbyNodeView> getAllNodes();  }
@Test public void getAllJobs() { List<StandbyNodeView> nodeViews = standbyNodeService.getAllNodes(); Assert.assertNotNull(nodeViews); Assert.assertTrue(nodeViews.size() == 0); }