mirror of https://github.com/usbharu/Hideout.git
test: sharedInboxのテストを追加
This commit is contained in:
parent
6173631abd
commit
c5566253fa
|
@ -1,4 +1,33 @@
|
|||
package dev.usbharu.hideout.routing.activitypub
|
||||
class InboxRoutingKtTest {
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue