@Test public void callableIsExecuted() throws Exception { when(guardRail.acquirePermits(eq(1L), anyLong())).thenReturn(null); String expectedResult = "Success"; String result = service.call(TestCallables.success(1)); verify(releaseFunction).apply(eq(TimeoutableResult.SUCCESS), any(ExecutionContext.class)); assertEquals(expectedResult, result); }
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);  }