@Test
  public void testParsingClusterVersion() throws Exception {
    final String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"
      + "<ClusterVersion Version=\"2.0.0\"/>";
    Client client = mock(Client.class);
    RemoteAdmin admin = new RemoteAdmin(client, HBaseConfiguration.create(), null);
    Response resp = new Response(200, null, Bytes.toBytes(xml));

    when(client.get("/version/cluster", Constants.MIMETYPE_XML)).thenReturn(resp);

    StorageClusterVersionModel cv = admin.getClusterVersion();
    assertEquals("2.0.0", cv.getVersion());
  }
Test class for {@link RemoteAdmin} to verify XML is parsed in a certain manner.
hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/client/TestXmlParsing.java