ApplicationMasterRestClient implements Closeable { public Map<String, Object> getTaskContext() throws IOException { String jsonString = getEntityAsJson("/task-context", "task context"); return jsonMapper.readValue(jsonString, new TypeReference<Map<String, Object>>() { }); } ApplicationMasterRestClient(CloseableHttpClient client, String amHostName, int amRpcPort); Map<String, Map<String, Object>> getMetrics(); Map<String, Object> getTaskContext(); Map<String, Object> getAmState(); Map<String, Object> getConfig(); @Override void close(); @Override String toString();  }
@Test public void testTaskContextError() throws IOException { setupErrorTest("task context"); ApplicationMasterRestClient client = new ApplicationMasterRestClient(mockClient, AM_HOST_NAME, AM_RPC_PORT); client.getTaskContext(); }