@Test
public void testGetClusterNodeAttributes() throws Exception {

  when(client.getClusterAttributes()).thenReturn(ImmutableSet
      .of(NodeAttributeInfo.newInstance(NodeAttributeKey.newInstance("GPU"),
          NodeAttributeType.STRING), NodeAttributeInfo
          .newInstance(NodeAttributeKey.newInstance("CPU"),
              NodeAttributeType.STRING)));
  ClusterCLI cli = createAndGetClusterCLI();
  int rc = cli.run(new String[] {ClusterCLI.CMD,
      "-" + ClusterCLI.LIST_CLUSTER_ATTRIBUTES});
  assertEquals(0, rc);
  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  PrintWriter pw = new PrintWriter(baos);
  pw.println("rm.yarn.io/GPU(STRING)");
  pw.println("rm.yarn.io/CPU(STRING)");
  pw.close();
  verify(sysOut).println(baos.toString("UTF-8"));
}