diff --git a/src/test/kotlin/dev/usbharu/hideout/routing/activitypub/InboxRoutingKtTest.kt b/src/test/kotlin/dev/usbharu/hideout/routing/activitypub/InboxRoutingKtTest.kt index 8e93e159..d1096731 100644 --- a/src/test/kotlin/dev/usbharu/hideout/routing/activitypub/InboxRoutingKtTest.kt +++ b/src/test/kotlin/dev/usbharu/hideout/routing/activitypub/InboxRoutingKtTest.kt @@ -1,7 +1,6 @@ package dev.usbharu.hideout.routing.activitypub import dev.usbharu.hideout.exception.JsonParseException -import dev.usbharu.hideout.plugins.configureRouting import dev.usbharu.hideout.plugins.configureSerialization import dev.usbharu.hideout.plugins.configureStatusPages import dev.usbharu.hideout.service.activitypub.ActivityPubService @@ -11,6 +10,7 @@ import dev.usbharu.hideout.service.signature.HttpSignatureVerifyService import io.ktor.client.request.* import io.ktor.http.* import io.ktor.server.config.* +import io.ktor.server.routing.* import io.ktor.server.testing.* import org.junit.jupiter.api.Assertions import org.junit.jupiter.api.Test @@ -27,7 +27,9 @@ class InboxRoutingKtTest { } application { configureSerialization() - configureRouting(mock(), mock(), mock(), mock(), mock()) + routing { + inbox(mock(), mock()) + } } client.get("/inbox").let { Assertions.assertEquals(HttpStatusCode.MethodNotAllowed, it.status) @@ -45,18 +47,14 @@ class InboxRoutingKtTest { val activityPubService = mock { on { parseActivity(any()) } doThrow JsonParseException() } - val userService = mock() - val activityPubUserService = mock() + mock() + mock() application { configureStatusPages() configureSerialization() - configureRouting( - httpSignatureVerifyService, - activityPubService, - userService, - activityPubUserService, - mock() - ) + routing { + inbox(httpSignatureVerifyService, activityPubService) + } } client.post("/inbox").let { Assertions.assertEquals(HttpStatusCode.BadRequest, it.status) @@ -70,7 +68,9 @@ class InboxRoutingKtTest { } application { configureSerialization() - configureRouting(mock(), mock(), mock(), mock(), mock()) + routing { + inbox(mock(), mock()) + } } client.get("/users/test/inbox").let { Assertions.assertEquals(HttpStatusCode.MethodNotAllowed, it.status) @@ -88,18 +88,14 @@ class InboxRoutingKtTest { val activityPubService = mock { on { parseActivity(any()) } doThrow JsonParseException() } - val userService = mock() - val activityPubUserService = mock() + mock() + mock() application { configureStatusPages() configureSerialization() - configureRouting( - httpSignatureVerifyService, - activityPubService, - userService, - activityPubUserService, - mock() - ) + routing { + inbox(httpSignatureVerifyService, activityPubService) + } } client.post("/users/test/inbox").let { Assertions.assertEquals(HttpStatusCode.BadRequest, it.status)