@Test
public void testSuccessfulJobSubmission() throws Exception {

	DispatcherGateway mockGateway = mock(DispatcherGateway.class);
	when(mockGateway.submitJob(any(JobGraph.class), any(Time.class))).thenReturn(CompletableFuture.completedFuture(Acknowledge.get()));
	GatewayRetriever<DispatcherGateway> mockGatewayRetriever = mock(GatewayRetriever.class);
	JobSubmitHandler handler = new JobSubmitHandler(
		CompletableFuture.completedFuture("http://localhost:1234"),
		mockGatewayRetriever,
		RpcUtils.INF_TIMEOUT);
	JobGraph job = new JobGraph("testjob");
	JobSubmitRequestBody request = new JobSubmitRequestBody(job);
	handler.handleRequest(new HandlerRequest<>(request, EmptyMessageParameters.getInstance()), mockGateway)
		.get();
}