@Test
public void testGetBatchRequestResponse() throws Exception {

  Clusters clustersMock = createMock(Clusters.class);
  Cluster clusterMock = createMock(Cluster.class);
  Configuration configurationMock = createNiceMock(Configuration.class);
  ExecutionScheduler executionSchedulerMock = createMock(ExecutionScheduler.class);
  InternalTokenStorage tokenStorageMock = createMock(InternalTokenStorage.class);
  ActionDBAccessor actionDBAccessorMock = createMock(ActionDBAccessor.class);
  Gson gson = new Gson();
  long requestId = 5L;
  String clusterName = "mycluster";
  String apiUri = "api/v1/clusters/mycluster/requests/5";
  Capture<String> uriCapture = EasyMock.newCapture();
  BatchRequestResponse batchRequestResponse = new BatchRequestResponse();
  batchRequestResponse.setStatus(HostRoleStatus.IN_PROGRESS.toString());
  batchRequestResponse.setRequestId(requestId);
  batchRequestResponse.setReturnCode(202);
  EasyMock.expect(configurationMock.getApiSSLAuthentication()).andReturn(Boolean.FALSE);
  EasyMock.replay(configurationMock);
  ExecutionScheduleManager scheduleManager = createMockBuilder(ExecutionScheduleManager.class).
      withConstructor(configurationMock, executionSchedulerMock, tokenStorageMock, clustersMock,
          actionDBAccessorMock, gson).
      addMockedMethods("performApiGetRequest").createNiceMock();
  expect(scheduleManager.performApiGetRequest(capture(uriCapture), eq(true))).andReturn(batchRequestResponse).once();
  replay(clusterMock, clustersMock, executionSchedulerMock,
      tokenStorageMock, scheduleManager);
  scheduleManager.getBatchRequestResponse(requestId, clusterName);
  verify(clusterMock, clustersMock, configurationMock, executionSchedulerMock,
      tokenStorageMock, scheduleManager);
  assertEquals(apiUri, uriCapture.getValue());
}