Skip to content

Commit

Permalink
fix(velocity): update velocity server mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
bigspeedfpv committed Sep 24, 2024
1 parent 98714e8 commit df13b43
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -43,11 +44,11 @@ class MockedVelocityServer {
Mockito.`when`(scheduler.buildTask(Mockito.any(), Mockito.any(java.lang.Runnable::class.java))).thenAnswer {
val runnable = it.getArgument<Runnable>(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
}

Expand All @@ -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)
Expand Down Expand Up @@ -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")
}
}

/**
Expand Down

0 comments on commit df13b43

Please sign in to comment.