zentol commented on a change in pull request #11469: URL: https://github.com/apache/flink/pull/11469#discussion_r472947504
########## File path: flink-clients/src/test/java/org/apache/flink/client/program/rest/RestClusterClientTest.java ########## @@ -306,94 +257,6 @@ private TestJobCancellationHandler() { } } - private class TestJobExecutionResultHandler - extends TestHandler<EmptyRequestBody, JobExecutionResultResponseBody, JobMessageParameters> { - - private final Iterator<Object> jobExecutionResults; - - private Object lastJobExecutionResult; - - private TestJobExecutionResultHandler( - final Object... jobExecutionResults) { - super(JobExecutionResultHeaders.getInstance()); - checkArgument(Arrays.stream(jobExecutionResults) - .allMatch(object -> object instanceof JobExecutionResultResponseBody - || object instanceof RestHandlerException)); - this.jobExecutionResults = Arrays.asList(jobExecutionResults).iterator(); - } - - @Override - protected CompletableFuture<JobExecutionResultResponseBody> handleRequest( - @Nonnull HandlerRequest<EmptyRequestBody, JobMessageParameters> request, - @Nonnull DispatcherGateway gateway) throws RestHandlerException { - if (jobExecutionResults.hasNext()) { - lastJobExecutionResult = jobExecutionResults.next(); - } - checkState(lastJobExecutionResult != null); - if (lastJobExecutionResult instanceof JobExecutionResultResponseBody) { - return CompletableFuture.completedFuture((JobExecutionResultResponseBody) lastJobExecutionResult); - } else if (lastJobExecutionResult instanceof RestHandlerException) { - return FutureUtils.completedExceptionally((RestHandlerException) lastJobExecutionResult); - } else { - throw new AssertionError(); - } - } - } - - @Test - public void testSubmitJobAndWaitForExecutionResult() throws Exception { Review comment: Well that's true, but these tests were written back when these utils were used for the actual job submission. So shouldn't we instead port them to the new submission API? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org