@Test
  public void testRemoteInvokeAsyncWithException() throws Exception {
    AsyncInvocation<Void> async =
        vm0.<Void>invokeAsync(BasicDistributedTest::remoteThrowException).join();

    assertThat(async.exceptionOccurred(), is(true));
    assertThat(async.getException(), instanceOf(BasicTestException.class));

    Throwable thrown = catchThrowable(async::await);

    assertThat(thrown, instanceOf(AssertionError.class));
    assertThat(thrown.getCause(), notNullValue());
    assertThat(thrown.getCause(), instanceOf(BasicTestException.class));
    assertThat(thrown.getCause().getMessage(), is(MESSAGE_FOR_remoteThrowException));
  }
This class tests the basic functionality of the distributed unit test framework.
geode-dunit/src/distributedTest/java/org/apache/geode/test/dunit/tests/BasicDistributedTest.java