Add test for DI constructability of UnlockSonePage
[Sone.git] / src / test / kotlin / net / pterodactylus / sone / web / pages / UnlockSonePageTest.kt
index 9cde13c..1c1ca7f 100644 (file)
@@ -1,11 +1,14 @@
 package net.pterodactylus.sone.web.pages
 
 import net.pterodactylus.sone.data.Sone
+import net.pterodactylus.sone.test.getInstance
 import net.pterodactylus.sone.test.mock
 import net.pterodactylus.sone.test.whenever
+import net.pterodactylus.sone.web.baseInjector
 import net.pterodactylus.util.web.Method.POST
 import org.hamcrest.MatcherAssert.assertThat
 import org.hamcrest.Matchers.equalTo
+import org.hamcrest.Matchers.notNullValue
 import org.junit.Test
 import org.mockito.ArgumentMatchers.any
 import org.mockito.Mockito.never
@@ -14,7 +17,7 @@ import org.mockito.Mockito.verify
 /**
  * Unit test for [UnlockSonePage].
  */
-class UnlockSonePageTest: WebPageTest2(::UnlockSonePage) {
+class UnlockSonePageTest: WebPageTest(::UnlockSonePage) {
 
        @Test
        fun `page returns correct path`() {
@@ -74,4 +77,9 @@ class UnlockSonePageTest: WebPageTest2(::UnlockSonePage) {
                }
        }
 
+       @Test
+       fun `page can be created by dependency injection`() {
+           assertThat(baseInjector.getInstance<UnlockSonePage>(), notNullValue())
+       }
+
 }