@Test(timeout = 5_000)
public void testCancellation() {

    AtomicReference<Object> resultRef = new AtomicReference<>();
    Disposable disposable = reactorSerializedInvoker.submit(Mono.delay(Duration.ofHours(1)).map(tick -> "First"))
            .doOnCancel(() -> resultRef.set("CANCELLED"))
            .subscribe(
                    resultRef::set,
                    resultRef::set
            );
    disposable.dispose();
    await().until(disposable::isDisposed);
    assertThat(resultRef.get()).isEqualTo("CANCELLED");
}