From: David ‘Bombe’ Roden Date: Fri, 17 May 2019 08:49:07 +0000 (+0200) Subject: 🎨 Fix formatting X-Git-Tag: v79^2~48 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=ec074a1c79056bf214a168341586070d7991694a;p=Sone.git 🎨 Fix formatting --- diff --git a/src/main/kotlin/net/pterodactylus/sone/main/FreenetModule.kt b/src/main/kotlin/net/pterodactylus/sone/main/FreenetModule.kt index 89d164d..9b5fa2e 100644 --- a/src/main/kotlin/net/pterodactylus/sone/main/FreenetModule.kt +++ b/src/main/kotlin/net/pterodactylus/sone/main/FreenetModule.kt @@ -1,19 +1,17 @@ package net.pterodactylus.sone.main -import com.google.inject.Binder -import com.google.inject.Module -import com.google.inject.Provides -import freenet.client.HighLevelSimpleClient +import com.google.inject.* +import freenet.client.* import freenet.clients.http.* -import freenet.node.Node -import freenet.pluginmanager.PluginRespirator +import freenet.node.* +import freenet.pluginmanager.* import javax.inject.Provider import javax.inject.Singleton /** * Guice [Module] that supplies some objects that are in fact supplied by the Freenet node. */ -class FreenetModule(private val pluginRespirator: PluginRespirator): Module { +class FreenetModule(private val pluginRespirator: PluginRespirator) : Module { override fun configure(binder: Binder): Unit = binder.run { bind(PluginRespirator::class.java).toProvider(Provider { pluginRespirator }) @@ -23,7 +21,8 @@ class FreenetModule(private val pluginRespirator: PluginRespirator): Module { bind(PageMaker::class.java).toProvider(Provider { pluginRespirator.pageMaker }) } - @Provides @Singleton + @Provides + @Singleton fun getSessionManager() = pluginRespirator.getSessionManager("Sone")!! } diff --git a/src/test/kotlin/net/pterodactylus/sone/main/FreenetModuleTest.kt b/src/test/kotlin/net/pterodactylus/sone/main/FreenetModuleTest.kt index d51da92..2f55d52 100644 --- a/src/test/kotlin/net/pterodactylus/sone/main/FreenetModuleTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/main/FreenetModuleTest.kt @@ -1,18 +1,15 @@ package net.pterodactylus.sone.main -import com.google.inject.Guice -import freenet.client.HighLevelSimpleClient +import com.google.inject.* +import freenet.client.* import freenet.clients.http.* -import freenet.node.Node -import freenet.pluginmanager.PluginRespirator -import net.pterodactylus.sone.test.deepMock -import net.pterodactylus.sone.test.getInstance -import net.pterodactylus.sone.test.mock -import net.pterodactylus.sone.test.whenever -import org.hamcrest.MatcherAssert.assertThat -import org.hamcrest.Matchers.sameInstance -import org.junit.Test -import org.mockito.Mockito.verify +import freenet.node.* +import freenet.pluginmanager.* +import net.pterodactylus.sone.test.* +import org.hamcrest.MatcherAssert.* +import org.hamcrest.Matchers.* +import org.junit.* +import org.mockito.Mockito.* /** * Unit test for [FreenetModule]. @@ -30,7 +27,7 @@ class FreenetModuleTest { private val module = FreenetModule(pluginRespirator) private val injector = Guice.createInjector(module) - private inline fun verifySingletonInstance() { + private inline fun verifySingletonInstance() { val firstInstance = injector.getInstance() val secondInstance = injector.getInstance() assertThat(firstInstance, sameInstance(secondInstance)) @@ -79,7 +76,7 @@ class FreenetModuleTest { @Test fun `toadlet container is returned correctly`() { - assertThat(injector.getInstance(), sameInstance(toadletContainer)) + assertThat(injector.getInstance(), sameInstance(toadletContainer)) } @Test