175176177178179180181182183184185
try { arg = (Runnable) invocation.getArguments()[1]; } catch (Exception e) { return null; } arg.run(); return null; }}); when(mockScheduler.scheduleSyncDelayedTask(any(Plugin.class), any(Runnable.class))). thenAnswer(new Answer<Integer>() { @Override
188189190191192193194195196197198
try { arg = (Runnable) invocation.getArguments()[1]; } catch (Exception e) { return null; } arg.run(); return null; }}); when(mockServer.getScheduler()).thenReturn(mockScheduler); // Set server