- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {}
@Override public void run() { action.perform(); runnables.remove(action); } };
@Test public void givenPositionThatDiffersFromPlayheadPosition_whenStartingPlayAtVideoPosition_thenSeeksToVideoPosition() { long differentPositionInMillis = givenPositionThatDiffersFromPlayheadPosition(); player.playAt(differentPositionInMillis); ArgumentCaptor<DelayedActionExecutor.Action> argumentCaptor = ArgumentCaptor.forClass(DelayedActionExecutor.Action.class); verify(delayedActionExecutor).performAfterDelay(argumentCaptor.capture(), eq(DELAY_MILLIS)); argumentCaptor.getValue().perform(); verify(mediaPlayer).seekTo(differentPositionInMillis); }
@Test public void whenPerformingActionAfterDelay_thenPerformsAction() { delayedActionExecutor = new DelayedActionExecutor(immediatelyExecutingHandler, runnables); delayedActionExecutor.performAfterDelay(action, ANY_DELAY_IN_MILLIS); verify(action).perform(); }