From 000ea292bd1f0f0a41cb1b0f02352db4cd55e112 Mon Sep 17 00:00:00 2001 From: shynixn Date: Wed, 3 Jan 2024 21:12:06 +0100 Subject: [PATCH] #107 Fixed minestom unittests. --- .../src/test/java/helper/MockedMinestomServer.kt | 8 ++++---- .../test/java/integrationtest/MinestomExceptionTest.kt | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mccoroutine-minestom-core/src/test/java/helper/MockedMinestomServer.kt b/mccoroutine-minestom-core/src/test/java/helper/MockedMinestomServer.kt index 5866bec2..8dfd84dc 100644 --- a/mccoroutine-minestom-core/src/test/java/helper/MockedMinestomServer.kt +++ b/mccoroutine-minestom-core/src/test/java/helper/MockedMinestomServer.kt @@ -1,11 +1,11 @@ package helper -import net.kyori.adventure.text.logger.slf4j.ComponentLogger import net.minestom.server.MinecraftServer import net.minestom.server.extensions.Extension +import org.slf4j.Logger class MockedMinestomServer { - fun boot(mlogger: ComponentLogger? = null): Extension { + fun boot(mlogger: Logger? = null): Extension { val extension = MockedExtension(mlogger) MinecraftServer.init() Thread { @@ -17,7 +17,7 @@ class MockedMinestomServer { return extension } - class MockedExtension(private val logger: ComponentLogger?) : Extension() { + class MockedExtension(private val logger: Logger?) : Extension() { override fun initialize() { } @@ -30,7 +30,7 @@ class MockedMinestomServer { * * @return The logger for the extension */ - override fun getLogger(): ComponentLogger { + override fun getLogger(): Logger { if (logger != null) { return logger } diff --git a/mccoroutine-minestom-core/src/test/java/integrationtest/MinestomExceptionTest.kt b/mccoroutine-minestom-core/src/test/java/integrationtest/MinestomExceptionTest.kt index f56e9e60..31b70c78 100644 --- a/mccoroutine-minestom-core/src/test/java/integrationtest/MinestomExceptionTest.kt +++ b/mccoroutine-minestom-core/src/test/java/integrationtest/MinestomExceptionTest.kt @@ -4,10 +4,10 @@ import com.github.shynixn.mccoroutine.minestom.launch import helper.MockedMinestomServer import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.runBlocking -import net.kyori.adventure.text.logger.slf4j.ComponentLogger import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test import org.mockito.Mockito +import org.slf4j.Logger class MinestomExceptionTest { /** @@ -22,7 +22,7 @@ class MinestomExceptionTest { fun extensionLaunch_MultipleFailingCoroutineScopes_ShouldBeCaughtInRootScopeAndKeepExtensionScopeRunning() { // Arrange val testServer = MockedMinestomServer() - val logger = Mockito.mock(ComponentLogger::class.java) + val logger = Mockito.mock(Logger::class.java) var logMessageCounter = 0 Mockito.`when`( logger.error(Mockito.anyString(), Mockito.any())