@Test public void acquirePermitReturnsNullIfNoRejections() { guardRail = builder.build(); when(backPressure.acquirePermit(1L, 10L)).thenReturn(null); when(backPressure2.acquirePermit(1L, 10L)).thenReturn(null); assertNull(guardRail.acquirePermits(1L, 10L)); }
public Rejected acquirePermits(long number) { return acquirePermits(number, clock.nanoTime()); }
GuardRail { public Rejected acquirePermits(long number) { return acquirePermits(number, clock.nanoTime()); } }
GuardRail { public Rejected acquirePermits(long number) { return acquirePermits(number, clock.nanoTime()); } private  GuardRail(GuardRailProperties<Result, Rejected> properties); }
GuardRail { public Rejected acquirePermits(long number) { return acquirePermits(number, clock.nanoTime()); } private  GuardRail(GuardRailProperties<Result, Rejected> properties); Rejected acquirePermits(long number); Rejected acquirePermits(long number, long nanoTime); void releasePermitsWithoutResult(long number); void releasePermitsWithoutResult(long number, long nanoTime); void releasePermits(ExecutionContext context, Result result); void releasePermits(ExecutionContext context, Result result, long nanoTime); void releasePermits(long number, Result result, long startNanos); void releasePermits(long number, Result result, long startNanos, long nanoTime); PrecipiceFunction<Result, ExecutionContext> releaseFunction(); String getName(); WritableCounts<Result> getResultCounts(); WritableCounts<Rejected> getRejectedCounts(); WritableLatency<Result> getResultLatency(); Map<String, BackPressure<Rejected>> getBackPressure(); Clock getClock(); static GuardRail<Result, Rejected> create(GuardRailProperties<Result, Rejected> properties); }
GuardRail { public Rejected acquirePermits(long number) { return acquirePermits(number, clock.nanoTime()); } private  GuardRail(GuardRailProperties<Result, Rejected> properties); Rejected acquirePermits(long number); Rejected acquirePermits(long number, long nanoTime); void releasePermitsWithoutResult(long number); void releasePermitsWithoutResult(long number, long nanoTime); void releasePermits(ExecutionContext context, Result result); void releasePermits(ExecutionContext context, Result result, long nanoTime); void releasePermits(long number, Result result, long startNanos); void releasePermits(long number, Result result, long startNanos, long nanoTime); PrecipiceFunction<Result, ExecutionContext> releaseFunction(); String getName(); WritableCounts<Result> getResultCounts(); WritableCounts<Rejected> getRejectedCounts(); WritableLatency<Result> getResultLatency(); Map<String, BackPressure<Rejected>> getBackPressure(); Clock getClock(); static GuardRail<Result, Rejected> create(GuardRailProperties<Result, Rejected> properties);  }