1 package net.pterodactylus.sone.main
3 import freenet.client.async.USKManager
4 import freenet.l10n.BaseL10n.LANGUAGE.ENGLISH
5 import freenet.node.Node
6 import freenet.node.NodeClientCore
7 import freenet.pluginmanager.PluginRespirator
8 import net.pterodactylus.sone.test.TestUtil
9 import net.pterodactylus.sone.test.deepMock
10 import net.pterodactylus.sone.test.whenever
14 * Unit test for [SonePlugin].
16 class SonePluginTest {
18 private val sonePlugin = SonePlugin()
19 private val pluginRespirator = deepMock<PluginRespirator>()
20 private val node = deepMock<Node>()
21 private val clientCore = deepMock<NodeClientCore>()
22 private val uskManager = deepMock<USKManager>()
25 TestUtil.setFinalField(node, "clientCore", clientCore)
26 whenever(pluginRespirator.node).thenReturn(node)
27 TestUtil.setFinalField(clientCore, "uskManager", uskManager)
31 fun `sone plugin can be started`() {
32 sonePlugin.setLanguage(ENGLISH)
33 sonePlugin.runPlugin(pluginRespirator)