@Test public void timeoutUsingFlux() { given(timeLimiter.getTimeLimiterConfig()) .willReturn(toConfig(Duration.ofMillis(1))); Flux<?> flux = Flux.interval(Duration.ofSeconds(1)) .transformDeferred(TimeLimiterOperator.of(timeLimiter)); StepVerifier.create(flux) .expectError(TimeoutException.class) .verify(Duration.ofMinutes(1)); then(timeLimiter).should() .onError(any(TimeoutException.class)); }
public static <T> TimeLimiterOperator<T> of(TimeLimiter timeLimiter) { return new TimeLimiterOperator<>(timeLimiter); }
TimeLimiterOperator implements UnaryOperator<Publisher<T>> { public static <T> TimeLimiterOperator<T> of(TimeLimiter timeLimiter) { return new TimeLimiterOperator<>(timeLimiter); } }
TimeLimiterOperator implements UnaryOperator<Publisher<T>> { public static <T> TimeLimiterOperator<T> of(TimeLimiter timeLimiter) { return new TimeLimiterOperator<>(timeLimiter); } private  TimeLimiterOperator(TimeLimiter timeLimiter); }
TimeLimiterOperator implements UnaryOperator<Publisher<T>> { public static <T> TimeLimiterOperator<T> of(TimeLimiter timeLimiter) { return new TimeLimiterOperator<>(timeLimiter); } private  TimeLimiterOperator(TimeLimiter timeLimiter); static TimeLimiterOperator<T> of(TimeLimiter timeLimiter); @Override Publisher<T> apply(Publisher<T> publisher); }
TimeLimiterOperator implements UnaryOperator<Publisher<T>> { public static <T> TimeLimiterOperator<T> of(TimeLimiter timeLimiter) { return new TimeLimiterOperator<>(timeLimiter); } private  TimeLimiterOperator(TimeLimiter timeLimiter); static TimeLimiterOperator<T> of(TimeLimiter timeLimiter); @Override Publisher<T> apply(Publisher<T> publisher);  }