StyxOkHttpClient implements StyxClient { @Override public CompletionStage<Backfill> backfillEditConcurrency(String backfillId, int concurrency) { final EditableBackfillInput editableBackfillInput = EditableBackfillInput.newBuilder() .id(backfillId) .concurrency(concurrency) .build(); var url = urlBuilder("backfills", backfillId); return execute(forUri(url, "PUT", editableBackfillInput), Backfill.class); } private  StyxOkHttpClient(String apiHost, FutureOkHttpClient client, GoogleIdTokenAuth auth); static StyxClient create(String apiHost); static StyxClient create(String apiHost, GoogleCredentials credentials); static StyxClient create(String apiHost, OkHttpClient client); static StyxClient create(String apiHost, OkHttpClient client, GoogleCredentials credentials); @Override CompletionStage<RunStateDataPayload> activeStates(Optional<String> componentId); @Override CompletionStage<List<EventInfo>> eventsForWorkflowInstance(String componentId,
                                                                    String workflowId,
                                                                    String parameter); @Override CompletionStage<TestServiceAccountUsageAuthorizationResponse> testServiceAccountUsageAuthorization(
      String serviceAccountEmail, String principalEmail); @Override CompletionStage<Workflow> workflow(String componentId, String workflowId); @Override CompletionStage<List<Workflow>> workflows(String componentId); @Override CompletionStage<List<Workflow>> workflows(); @Override CompletionStage<Workflow> createOrUpdateWorkflow(String componentId, WorkflowConfiguration workflowConfig); @Override CompletionStage<Void> deleteWorkflow(String componentId, String workflowId); @Override CompletionStage<WorkflowState> workflowState(String componentId, String workflowId); @Override CompletionStage<WorkflowWithState> workflowWithState(String componentId, String workflowId); @Override CompletionStage<WorkflowInstanceExecutionData> workflowInstanceExecutions(String componentId,
                                                                                   String workflowId,
                                                                                   String parameter); @Override CompletionStage<WorkflowState> updateWorkflowState(String componentId, String workflowId,
                                                            WorkflowState workflowState); @Override CompletionStage<Void> triggerWorkflowInstance(String componentId, String workflowId,
      String parameter); @Override CompletionStage<Void> triggerWorkflowInstance(String componentId,
                                                       String workflowId,
                                                       String parameter,
                                                       TriggerParameters triggerParameters); @Override CompletionStage<Void> triggerWorkflowInstance(String componentId,
                                                       String workflowId,
                                                       String parameter,
                                                       TriggerParameters triggerParameters,
                                                       boolean allowFuture); @Override CompletionStage<Void> haltWorkflowInstance(String componentId,
                                                    String workflowId,
                                                    String parameter); @Override CompletionStage<Void> retryWorkflowInstance(String componentId,
                                                     String workflowId,
                                                     String parameter); @Override CompletionStage<Resource> resourceCreate(String resourceId, int concurrency); @Override CompletionStage<Resource> resourceEdit(String resourceId, int concurrency); @Override CompletionStage<Resource> resource(String resourceId); @Override CompletionStage<ResourcesPayload> resourceList(); @Override CompletionStage<Backfill> backfillCreate(String componentId, String workflowId,
                                                  String start, String end,
                                                  int concurrency); @Override CompletionStage<Backfill> backfillCreate(String componentId, String workflowId,
                                                  String start, String end,
                                                  int concurrency,
                                                  String description); @Override CompletionStage<Backfill> backfillCreate(BackfillInput backfill); @Override CompletionStage<Backfill> backfillCreate(BackfillInput backfill, boolean allowFuture); @Override CompletionStage<Backfill> backfillEditConcurrency(String backfillId, int concurrency); @Override CompletionStage<Void> backfillHalt(String backfillId); @Override CompletionStage<Void> backfillHalt(String backfillId, boolean graceful); @Override CompletionStage<BackfillPayload> backfill(String backfillId, boolean includeStatus); @Override CompletionStage<BackfillsPayload> backfillList(Optional<String> componentId,
                                                        Optional<String> workflowId,
                                                        boolean showAll,
                                                        boolean includeStatus); @Override void close();  }
@Test public void shouldUpdateBackfillConcurrency() throws Exception { final EditableBackfillInput backfillInput = EditableBackfillInput.newBuilder() .id(BACKFILL.id()) .concurrency(4) .build(); when(client.send(any(Request.class))) .thenReturn(CompletableFuture.completedFuture( response(HTTP_OK, BACKFILL.builder().concurrency(4).build()))); final CompletableFuture<Backfill> r = styx.backfillEditConcurrency(BACKFILL.id(), 4) .toCompletableFuture(); verify(client, timeout(30_000)).send(requestCaptor.capture()); assertThat(r.isDone(), is(true)); final Request request = requestCaptor.getValue(); assertThat(request.url().toString(), is(API_URL + "/backfills/" + BACKFILL.id())); assertThat(Json.deserialize(bytesOfRequestBody(request), EditableBackfillInput.class), equalTo(backfillInput)); assertThat(request.method(), is("PUT")); }