pluginRespirator.node!!.let { node -> bind(Node::class.java).toProvider(Provider<Node> { node }) }
bind(HighLevelSimpleClient::class.java).toProvider(Provider<HighLevelSimpleClient> { pluginRespirator.hlSimpleClient!! })
bind(ToadletContainer::class.java).toProvider(Provider<ToadletContainer> { pluginRespirator.toadletContainer })
+ bind(PageMaker::class.java).toProvider(Provider<PageMaker> { pluginRespirator.pageMaker })
}
@Provides @Singleton
private val node = pluginRespirator.node!!
private val highLevelSimpleClient = pluginRespirator.hlSimpleClient!!
private val toadletContainer: ToadletContainer = pluginRespirator.toadletContainer
+ private val pageMaker: PageMaker = pluginRespirator.pageMaker
private val module = FreenetModule(pluginRespirator)
private val injector = Guice.createInjector(module)
verifySingletonInstance<ToadletContainer>()
}
+ @Test
+ fun `page maker is returned correctly`() {
+ assertThat(injector.getInstance(), sameInstance(pageMaker))
+ }
+
+ @Test
+ fun `page maker is returned as singleten`() {
+ verifySingletonInstance<PageMaker>()
+ }
+
}