Skip to content

Commit

Permalink
Merge pull request #109 from Shynixn/development
Browse files Browse the repository at this point in the history
Merge changes to master --release
  • Loading branch information
Shynixn authored Jan 3, 2024
2 parents 26bb4a9 + 000ea29 commit 9887265
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
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

0 comments on commit 9887265

Please sign in to comment.