ExecutorApiGateway { public Map<String, Object> updateExecutions(final Executor executor, final List<ExecutableFlow> executions) throws ExecutorManagerException { final List<Long> updateTimesList = new ArrayList<>(); final List<Integer> executionIdsList = new ArrayList<>(); for (final ExecutableFlow flow : executions) { executionIdsList.add(flow.getExecutionId()); updateTimesList.add(flow.getUpdateTime()); } final Pair<String, String> updateTimes = new Pair<>( ConnectorParams.UPDATE_TIME_LIST_PARAM, JSONUtils.toJSON(updateTimesList)); final Pair<String, String> executionIds = new Pair<>( ConnectorParams.EXEC_ID_LIST_PARAM, JSONUtils.toJSON(executionIdsList)); return callWithExecutionId(executor.getHost(), executor.getPort(), ConnectorParams.UPDATE_ACTION, null, null, executionIds, updateTimes); } @Inject  ExecutorApiGateway(final ExecutorApiClient apiClient); Map<String, Object> updateExecutions(final Executor executor,
      final List<ExecutableFlow> executions);  }
@Test public void updateExecutions() throws Exception { final ImmutableMap<String, String> map = ImmutableMap.of("test", "response"); when(this.client .httpPost(eq(new URI("http: .thenReturn(JSONUtils.toJSON(map)); final Map<String, Object> response = this.gateway .updateExecutions(new Executor(2, "executor-2", 1234, true), Collections.singletonList(new ExecutableFlow())); assertEquals(map, response); assertEquals(new Pair<>("executionId", "[-1]"), this.params.getValue().get(0)); assertEquals(new Pair<>("updatetime", "[-1]"), this.params.getValue().get(1)); assertEquals(new Pair<>("action", "update"), this.params.getValue().get(2)); assertEquals(new Pair<>("execid", "null"), this.params.getValue().get(3)); assertEquals(new Pair<>("user", null), this.params.getValue().get(4)); }