Github user zentol commented on a diff in the pull request:
https://github.com/apache/flink/pull/6203#discussion_r199456197
--- Diff: flink-runtime/src/test/java/org/apache/flink/runtime/rest/handler/job/JobSubmitHandlerTest.java
---
@@ -119,15 +113,17 @@ public void testSuccessfulJobSubmission() throws Exception {
}
}
- DispatcherGateway mockGateway = mock(DispatcherGateway.class);
- when(mockGateway.getHostname()).thenReturn("localhost");
- when(mockGateway.getBlobServerPort(any(Time.class))).thenReturn(CompletableFuture.completedFuture(blobServer.getPort()));
- when(mockGateway.submitJob(any(JobGraph.class), any(Time.class))).thenReturn(CompletableFuture.completedFuture(Acknowledge.get()));
- GatewayRetriever<DispatcherGateway> mockGatewayRetriever = mock(GatewayRetriever.class);
+ TestingDispatcherGateway.Builder builder = new TestingDispatcherGateway.Builder();
--- End diff --
This block is written the way it is since methods that the `TestingDispatcherGateway.Builder`
inherits return a `TestingRestfulGateway.Builder`, which also applies to `build`.
it's a bit cumbersome, but I couldn't find a solution that doesn't include copying the
entire `TestingRestfulGateway.Builder`.
---
|