RMAdminCLI extends HAAdmin { private int refreshNodes(boolean graceful) throws IOException, YarnException { ResourceManagerAdministrationProtocol adminProtocol = createAdminProtocol(); RefreshNodesRequest request = RefreshNodesRequest.newInstance( graceful? DecommissionType.GRACEFUL : DecommissionType.NORMAL); adminProtocol.refreshNodes(request); return 0; } RMAdminCLI();  RMAdminCLI(Configuration conf); @Override int run(String[] args); @Override void setConf(Configuration conf); static void main(String[] args);  }
@Test public void testRefreshNodes() throws Exception { String[] args = { "-refreshNodes" }; assertEquals(0, rmAdminCLI.run(args)); verify(admin).refreshNodes(any(RefreshNodesRequest.class)); }