mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-07 08:39:17 +00:00
Support npc and object definitions in plugin tests
This commit is contained in:
@@ -2,13 +2,13 @@
|
||||
import org.apollo.cache.def.ItemDefinition
|
||||
import org.apollo.game.model.entity.Player
|
||||
import org.apollo.game.plugin.skills.mining.Ore
|
||||
import org.apollo.game.plugin.testing.assertions.contains
|
||||
import org.apollo.game.plugin.testing.assertions.verifyAfter
|
||||
import org.apollo.game.plugin.testing.junit.ApolloTestingExtension
|
||||
import org.apollo.game.plugin.testing.junit.api.ActionCapture
|
||||
import org.apollo.game.plugin.testing.junit.api.annotations.ItemDefinitions
|
||||
import org.apollo.game.plugin.testing.junit.api.annotations.TestMock
|
||||
import org.apollo.game.plugin.testing.junit.api.interactions.interactWithObject
|
||||
import org.apollo.game.plugin.testing.assertions.contains
|
||||
import org.junit.jupiter.api.extension.ExtendWith
|
||||
import org.junit.jupiter.params.ParameterizedTest
|
||||
import org.junit.jupiter.params.provider.ArgumentsSource
|
||||
@@ -16,11 +16,6 @@ import org.junit.jupiter.params.provider.ArgumentsSource
|
||||
@ExtendWith(ApolloTestingExtension::class)
|
||||
class ProspectingTests {
|
||||
|
||||
@ItemDefinitions
|
||||
fun ores() = Ore.values().map {
|
||||
ItemDefinition(it.id).also { it.name = "<ore_type>" }
|
||||
}
|
||||
|
||||
@TestMock
|
||||
lateinit var player: Player
|
||||
|
||||
@@ -43,4 +38,12 @@ class ProspectingTests {
|
||||
|
||||
verifyAfter(action.complete()) { player.sendMessage(contains("no ore available in this rock")) }
|
||||
}
|
||||
|
||||
private companion object {
|
||||
@ItemDefinitions
|
||||
fun ores() = Ore.values().map {
|
||||
ItemDefinition(it.id).also { it.name = "<ore_type>" }
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user