Search in sources :

Example 1 with GlobalRpcCommand

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;
}
Also used : GlobalRpcCommand(org.infinispan.commands.GlobalRpcCommand)

Example 2 with GlobalRpcCommand

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);
}
Also used : GlobalRpcCommand(org.infinispan.commands.GlobalRpcCommand)

Aggregations

GlobalRpcCommand (org.infinispan.commands.GlobalRpcCommand)2