✅ Add test for URI creator being created by Guice
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 11 Feb 2020 18:21:27 +0000 (19:21 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 11 Feb 2020 18:21:27 +0000 (19:21 +0100)
src/test/java/net/pterodactylus/sone/core/SoneUriCreatorTest.kt

index cd7d541..ae8f25b 100644 (file)
@@ -1,13 +1,16 @@
 package net.pterodactylus.sone.core
 
+import com.google.inject.Guice
 import net.pterodactylus.sone.data.impl.IdOnlySone
 import net.pterodactylus.sone.freenet.wot.DefaultIdentity
 import net.pterodactylus.sone.freenet.wot.DefaultOwnIdentity
 import net.pterodactylus.sone.test.createInsertUri
 import net.pterodactylus.sone.test.createRequestUri
+import net.pterodactylus.sone.test.getInstance
 import org.hamcrest.MatcherAssert.assertThat
 import org.hamcrest.Matchers.emptyArray
 import org.hamcrest.Matchers.equalTo
+import org.hamcrest.Matchers.notNullValue
 import org.hamcrest.Matchers.nullValue
 import kotlin.test.Test
 
@@ -69,6 +72,12 @@ class SoneUriCreatorTest {
                assertThat(insertUri!!.suggestedEdition, equalTo(123L))
        }
 
+       @Test
+       fun `creator can be created by guice`() {
+               val injector = Guice.createInjector()
+               assertThat(injector.getInstance<SoneUriCreator>(), notNullValue())
+       }
+
 }
 
 private val sone = object : IdOnlySone("id") {