@Test
public void testGetYarnGpuResourceInfo()
    throws YarnException, JSONException {

  setupMockPluginsWithGpuResourceInfo();
  WebResource r = resource();
  ClientResponse response = getNMResourceResponse(r, "resource-1");
  assertEquals("MediaType of the response is not the expected!",
      MediaType.APPLICATION_JSON + "; " + JettyUtils.UTF_8,
      response.getType().toString());
  JSONObject json = response.getEntity(JSONObject.class);
  assertEquals("Unexpected driverVersion in the json response!",
      "1.2.3",
      json.getJSONObject("gpuDeviceInformation").get("driverVersion"));
  assertEquals("Unexpected totalGpuDevices in the json response!",
      3, json.getJSONArray("totalGpuDevices").length());
  assertEquals("Unexpected assignedGpuDevices in the json response!",
      2, json.getJSONArray("assignedGpuDevices").length());
}