From df13b4397df218c5b32289bf9b184384f59cc46a Mon Sep 17 00:00:00 2001 From: Andrew Brower Date: Tue, 24 Sep 2024 09:54:33 +0000 Subject: [PATCH] fix(velocity): update velocity server mocks --- .../src/test/java/helper/MockedVelocityServer.kt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/mccoroutine-velocity-core/src/test/java/helper/MockedVelocityServer.kt b/mccoroutine-velocity-core/src/test/java/helper/MockedVelocityServer.kt index 788f8a3e..0a50e466 100644 --- a/mccoroutine-velocity-core/src/test/java/helper/MockedVelocityServer.kt +++ b/mccoroutine-velocity-core/src/test/java/helper/MockedVelocityServer.kt @@ -15,6 +15,7 @@ import kotlinx.coroutines.Runnable import org.mockito.Mockito import org.slf4j.Logger import java.util.* +import java.util.concurrent.ExecutorService import java.util.concurrent.Executors import java.util.concurrent.TimeUnit import kotlin.coroutines.CoroutineContext @@ -43,11 +44,11 @@ class MockedVelocityServer { Mockito.`when`(scheduler.buildTask(Mockito.any(), Mockito.any(java.lang.Runnable::class.java))).thenAnswer { val runnable = it.getArgument(1) object : Scheduler.TaskBuilder { - override fun delay(time: Long, unit: TimeUnit?): Scheduler.TaskBuilder { + override fun delay(p0: Long, p1: TimeUnit): Scheduler.TaskBuilder { return this } - override fun repeat(time: Long, unit: TimeUnit?): Scheduler.TaskBuilder { + override fun repeat(p0: Long, p1: TimeUnit): Scheduler.TaskBuilder { return this } @@ -69,7 +70,7 @@ class MockedVelocityServer { Mockito.`when`(server.pluginManager).thenReturn(pluginManager) Mockito.`when`(pluginManager.isLoaded(Mockito.anyString())).thenReturn(true) - val commandManager = VelocityCommandManager(eventManager) + val commandManager = VelocityCommandManager(eventManager, pluginManager) Mockito.`when`(server.commandManager).thenReturn(commandManager) val plugin = MockedPluginContainer(server, logger) @@ -102,6 +103,11 @@ class MockedVelocityServer { override fun getInstance(): Optional<*> { return Optional.of(this) } + + // not used in our tests :3 (for now) + override fun getExecutorService(): ExecutorService { + TODO("Not yet implemented") + } } /**