public String getTaskState(String taskName)
      throws IOException, HttpException {
    HttpGet httpGet = createHttpGetRequest(MinionRequestURLBuilder.baseUrl(_controllerUrl).forTaskState(taskName));
    try (CloseableHttpResponse response = HTTP_CLIENT.execute(httpGet)) {
      int statusCode = response.getCode();
      String responseString = EntityUtils.toString(response.getEntity());
      if (statusCode >= 400) {
        throw new HttpException(
            String.format("Unable to get state for task: %s. Error code %d, Error message: %s", taskName, statusCode,
                responseString));
      }
      return responseString;
    }
  }
@Test
  public void testTaskState()
      throws IOException, HttpException {
    HttpServer httpServer = startServer(14204, "/tasks/task/Task_SegmentGenerationAndPushTask_1607470525615/state",
        createHandler(200, "\"COMPLETED\"", 0));
    MinionClient minionClient = new MinionClient("http://localhost:14204", null);
    Assert.assertEquals(minionClient.getTaskState("Task_SegmentGenerationAndPushTask_1607470525615"), "\"COMPLETED\"");
    httpServer.stop(0);
  }