@Test public void callableExceptionIsHandledAppropriately() throws Exception { when(guardRail.acquirePermits(eq(1L), anyLong())).thenReturn(null); RuntimeException exception = new RuntimeException(); try { service.call(TestCallables.erred(exception)); } catch (Exception e) { assertEquals(e, exception); } verify(releaseFunction).apply(eq(TimeoutableResult.ERROR), any(ExecutionContext.class)); }
public <T> T call(Callable<T> callable) throws Exception { return call(callable, 1L); }
CallService implements Precipice<TimeoutableResult, Rejected> { public <T> T call(Callable<T> callable) throws Exception { return call(callable, 1L); } }
CallService implements Precipice<TimeoutableResult, Rejected> { public <T> T call(Callable<T> callable) throws Exception { return call(callable, 1L); } CallService(GuardRail<TimeoutableResult, Rejected> guardRail); }
CallService implements Precipice<TimeoutableResult, Rejected> { public <T> T call(Callable<T> callable) throws Exception { return call(callable, 1L); } CallService(GuardRail<TimeoutableResult, Rejected> guardRail); @Override GuardRail<TimeoutableResult, Rejected> guardRail(); T call(Callable<T> callable); T call(Callable<T> callable, long permitNumber); }
CallService implements Precipice<TimeoutableResult, Rejected> { public <T> T call(Callable<T> callable) throws Exception { return call(callable, 1L); } CallService(GuardRail<TimeoutableResult, Rejected> guardRail); @Override GuardRail<TimeoutableResult, Rejected> guardRail(); T call(Callable<T> callable); T call(Callable<T> callable, long permitNumber);  }