@Test
public void testPortRetrieval() throws Exception {

	DispatcherGateway mockGateway = mock(DispatcherGateway.class);
	when(mockGateway.getBlobServerPort(any(Time.class)))
		.thenReturn(CompletableFuture.completedFuture(PORT));
	GatewayRetriever<DispatcherGateway> mockGatewayRetriever = mock(GatewayRetriever.class);
	BlobServerPortHandler handler = new BlobServerPortHandler(
		CompletableFuture.completedFuture("http://localhost:1234"),
		mockGatewayRetriever,
		RpcUtils.INF_TIMEOUT);
	BlobServerPortResponseBody portResponse = handler
		.handleRequest(new HandlerRequest<>(EmptyRequestBody.getInstance(), EmptyMessageParameters.getInstance()), mockGateway)
		.get();
	Assert.assertEquals(PORT, portResponse.port);
}