mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-14 14:45:31 +01:00
Implement initial test using MockBukkit.
This commit is contained in:
parent
698d1c7954
commit
eebb4a4a6d
@ -14,7 +14,7 @@ description = 'Multiverse-Core'
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion.set(JavaLanguageVersion.of(11))
|
||||
languageVersion.set(JavaLanguageVersion.of(17))
|
||||
}
|
||||
}
|
||||
|
||||
@ -92,7 +92,7 @@ dependencies {
|
||||
|
||||
// Tests
|
||||
testImplementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.10'
|
||||
testImplementation 'org.spigotmc:spigot-api:1.19.3-R0.1-SNAPSHOT'
|
||||
testImplementation 'com.github.seeseemelk:MockBukkit-v1.19:2.145.0'
|
||||
testImplementation('com.googlecode.json-simple:json-simple:1.1.1') {
|
||||
exclude group: 'junit', module: 'junit'
|
||||
}
|
||||
|
@ -0,0 +1,33 @@
|
||||
package org.mvplugins.multiverse.core
|
||||
|
||||
import be.seeseemelk.mockbukkit.MockBukkit
|
||||
import com.onarandombox.MultiverseCore.MultiverseCore
|
||||
import com.onarandombox.MultiverseCore.utils.TestingMode
|
||||
import org.bukkit.Server
|
||||
import kotlin.test.AfterTest
|
||||
import kotlin.test.BeforeTest
|
||||
import kotlin.test.Test
|
||||
import kotlin.test.assertNotNull
|
||||
|
||||
class MockBukkitTest {
|
||||
|
||||
lateinit var server: Server
|
||||
lateinit var plugin: MultiverseCore
|
||||
|
||||
@BeforeTest
|
||||
fun setUp() {
|
||||
TestingMode.enable()
|
||||
server = MockBukkit.mock()
|
||||
plugin = MockBukkit.load(MultiverseCore::class.java)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun test() {
|
||||
assertNotNull(plugin)
|
||||
}
|
||||
|
||||
@AfterTest
|
||||
fun tearDown() {
|
||||
MockBukkit.unmock()
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user