use of org.bukkit.scheduler.BukkitWorker in project AuthMeReloaded by AuthMe.
the class TaskCloserTest method mockBukkitWorker.
private BukkitWorker mockBukkitWorker(Plugin owner, int taskId, boolean isQueued) {
BukkitWorker worker = mock(BukkitWorker.class);
given(worker.getOwner()).willReturn(owner);
given(worker.getTaskId()).willReturn(taskId);
given(bukkitScheduler.isQueued(taskId)).willReturn(isQueued);
return worker;
}
use of org.bukkit.scheduler.BukkitWorker in project AuthMeReloaded by AuthMe.
the class TaskCloserTest method mockActiveWorkers.
private void mockActiveWorkers() {
Plugin otherOwner = mock(Plugin.class);
List<BukkitWorker> tasks = Arrays.asList(mockBukkitWorker(authMe, ACTIVE_WORKERS_ID[0], false), mockBukkitWorker(otherOwner, 3, false), mockBukkitWorker(authMe, ACTIVE_WORKERS_ID[1], false), mockBukkitWorker(authMe, 7, true), mockBukkitWorker(otherOwner, 11, true));
given(bukkitScheduler.getActiveWorkers()).willReturn(tasks);
}
Aggregations