Support npc and object definitions in plugin tests

This commit is contained in:
Major
2018-08-21 00:47:23 +01:00
committed by Major-
parent 71158b3b5e
commit 86fba62ab9
10 changed files with 182 additions and 72 deletions
@@ -13,11 +13,6 @@ import org.junit.jupiter.params.provider.EnumSource
@ExtendWith(ApolloTestingExtension::class)
class PickaxeTests {
@ItemDefinitions
fun pickaxes() = Pickaxe.values().map {
ItemDefinition(it.id).apply { isStackable = false }
}
@TestMock
lateinit var player: Player
@@ -72,4 +67,11 @@ class PickaxeTests {
assertEquals(pickaxe, Pickaxe.bestFor(player))
}
private companion object {
@ItemDefinitions
fun pickaxes() = Pickaxe.values().map {
ItemDefinition(it.id).apply { isStackable = false }
}
}
}