Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge changes to master --release #109

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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() {
}

Expand All @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
/**
Expand All @@ -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())
Expand Down
Loading