GitHub user StephanEwen opened a pull request:
https://github.com/apache/flink/pull/2394
[FLINK-4434] [rpc] Add a testing RPC service.
Adds an RPC Service implementation for testing. This RPC service acts as a
replacement for the regular RPC service for cases where tests need to return
prepared mock gateways instead of proper RPC gateways.
The TestingRpcService can be used for example in the following fashion,
using *Mockito* for mocks and verification:
```java
TestingRpcService rpc = new TestingRpcService();
ResourceManagerGateway testGateway = mock(ResourceManagerGateway.class);
rpc.registerGateway("myAddress", testGateway);
MyComponentToTest component = new MyComponentToTest();
component.triggerSomethingThatCallsTheGateway();
verify(testGateway, timeout(1000)).theTestMethod(any(UUID.class),
anyString());
```
This also adds a utility to create futures with a predetermined timeout.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/StephanEwen/incubator-flink test_rpc_service
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/2394.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2394
----
commit a685ffa00d748de4ab22f91b1dc3b6420f687c24
Author: Stephan Ewen <[email protected]>
Date: 2016-08-19T21:29:45Z
[FLINK-4434] [rpc] Add a testing RPC service.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---