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.*
12 * Unit test for [SonePlugin].
14 class SonePluginTest {
16 private val sonePlugin = SonePlugin()
17 private val pluginRespirator = deepMock<PluginRespirator>()
18 private val node = deepMock<Node>()
19 private val clientCore = deepMock<NodeClientCore>()
20 private val uskManager = deepMock<USKManager>()
23 setField(node, "clientCore", clientCore)
24 whenever(pluginRespirator.node).thenReturn(node)
25 setField(clientCore, "uskManager", uskManager)
29 fun `sone plugin can be started`() {
30 sonePlugin.setLanguage(ENGLISH)
31 sonePlugin.runPlugin(pluginRespirator)