Package com.nurkiewicz.asyncretry.policy

Examples of com.nurkiewicz.asyncretry.policy.AbortRetryException


  @Test
  public void shouldAbortWhenTargetFutureWantsToAbort() throws Exception {
    //given
    final RetryExecutor executor = new AsyncRetryExecutor(schedulerMock);
    given(serviceMock.safeAsync()).willReturn(
        failedAsync(new AbortRetryException())
    );

    //when
    final CompletableFuture<String> future = executor.getFutureWithRetry(ctx -> serviceMock.safeAsync());
View Full Code Here


    final RetryExecutor executor = new AsyncRetryExecutor(schedulerMock);
    given(serviceMock.sometimesFails()).
        willThrow(
            new IllegalArgumentException("First"),
            new IllegalStateException("Second"),
            new AbortRetryException()
        );

    //when
    final CompletableFuture<String> future = executor.getWithRetry(serviceMock::sometimesFails);
View Full Code Here

TOP

Related Classes of com.nurkiewicz.asyncretry.policy.AbortRetryException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.