From c5566253fa877600c74949ae0df6f62a461cf5f4 Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Mon, 10 Apr 2023 14:20:41 +0900 Subject: [PATCH] =?UTF-8?q?test:=20sharedInbox=E3=81=AE=E3=83=86=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../routing/activitypub/InboxRoutingKtTest.kt | 31 ++++++++++++++++++- .../routing/activitypub/UsersAPTest.kt | 2 +- 2 files changed, 31 insertions(+), 2 deletions(-) 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 3ad053bf..05f8596f 100644 --- a/src/test/kotlin/dev/usbharu/hideout/routing/activitypub/InboxRoutingKtTest.kt +++ b/src/test/kotlin/dev/usbharu/hideout/routing/activitypub/InboxRoutingKtTest.kt @@ -1,4 +1,33 @@ package dev.usbharu.hideout.routing.activitypub + +import com.fasterxml.jackson.annotation.JsonInclude +import com.fasterxml.jackson.annotation.JsonSetter +import com.fasterxml.jackson.annotation.Nulls +import com.fasterxml.jackson.databind.DeserializationFeature +import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper +import dev.usbharu.hideout.plugins.configureRouting +import dev.usbharu.hideout.plugins.configureSerialization +import io.ktor.client.request.* +import io.ktor.client.statement.* +import io.ktor.http.* +import io.ktor.server.config.* +import io.ktor.server.testing.* +import org.junit.jupiter.api.Assertions +import org.junit.jupiter.api.Test +import org.mockito.kotlin.mock + class InboxRoutingKtTest { - + @Test + fun `sharedInboxにGETしたら501が帰ってくる`() = testApplication { + environment { + config = ApplicationConfig("empty.conf") + } + application { + configureSerialization() + configureRouting(mock(), mock(), mock(), mock()) + } + client.get("/inbox").let { + Assertions.assertEquals(HttpStatusCode.MethodNotAllowed, it.status) + } + } } diff --git a/src/test/kotlin/dev/usbharu/hideout/routing/activitypub/UsersAPTest.kt b/src/test/kotlin/dev/usbharu/hideout/routing/activitypub/UsersAPTest.kt index 32b6cb17..e09f504b 100644 --- a/src/test/kotlin/dev/usbharu/hideout/routing/activitypub/UsersAPTest.kt +++ b/src/test/kotlin/dev/usbharu/hideout/routing/activitypub/UsersAPTest.kt @@ -31,7 +31,7 @@ import kotlin.test.assertEquals class UsersAPTest { @Test() - fun `ユーザのURLにAcceptヘッダーをActivityにしてアクセスしたときPersonが返ってくるか`() = testApplication { + fun `ユーザのURLにAcceptヘッダーをActivityにしてアクセスしたときPersonが返ってくる`() = testApplication { environment { config = ApplicationConfig("empty.conf") }