✨ Annotate LogoutPage with MenuName
[Sone.git] / src / test / kotlin / net / pterodactylus / sone / main / SonePluginTest.kt
1 package net.pterodactylus.sone.main
2
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
11 import org.junit.Test
12
13 /**
14  * Unit test for [SonePlugin].
15  */
16 class SonePluginTest {
17
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>()
23
24         init {
25                 TestUtil.setFinalField(node, "clientCore", clientCore)
26                 whenever(pluginRespirator.node).thenReturn(node)
27                 TestUtil.setFinalField(clientCore, "uskManager", uskManager)
28         }
29
30         @Test
31         fun `sone plugin can be started`() {
32                 sonePlugin.setLanguage(ENGLISH)
33                 sonePlugin.runPlugin(pluginRespirator)
34         }
35
36 }