use of org.infinispan.commands.GlobalRpcCommand in project infinispan by infinispan.
the class AsynchronousInvocationTest method mockGlobalRpcCommand.
private static GlobalRpcCommand mockGlobalRpcCommand(boolean blocking) throws Throwable {
GlobalRpcCommand mock = mock(GlobalRpcCommand.class);
when(mock.canBlock()).thenReturn(blocking);
when(mock.invokeAsync(any())).thenReturn(CompletableFutures.completedNull());
return mock;
}
use of org.infinispan.commands.GlobalRpcCommand in project infinispan by infinispan.
the class AsynchronousInvocationTest method testGlobalRpcCommands.
public void testGlobalRpcCommands() throws Throwable {
GlobalRpcCommand blockingGlobalRpcCommand = mockGlobalRpcCommand(true);
assertDispatchForCommand(blockingGlobalRpcCommand, true);
GlobalRpcCommand nonBlockingGlobalRpcCommand = mockGlobalRpcCommand(false);
assertDispatchForCommand(nonBlockingGlobalRpcCommand, false);
}
Aggregations