mirror of https://github.com/usbharu/Hideout.git
test: ユーザーのinboxのPOSTのテストを追加
This commit is contained in:
parent
02501287d4
commit
8f27746ff2
|
@ -70,4 +70,27 @@ class InboxRoutingKtTest {
|
||||||
Assertions.assertEquals(HttpStatusCode.MethodNotAllowed, it.status)
|
Assertions.assertEquals(HttpStatusCode.MethodNotAllowed, it.status)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `ユーザーのinboxに空のリクエストボディでPOSTしたら400が帰ってくる`() = testApplication {
|
||||||
|
environment {
|
||||||
|
config = ApplicationConfig("empty.conf")
|
||||||
|
}
|
||||||
|
val httpSignatureVerifyService = mock<HttpSignatureVerifyService>{
|
||||||
|
on { verify(any()) } doReturn true
|
||||||
|
}
|
||||||
|
val activityPubService = mock<ActivityPubService>{
|
||||||
|
on { parseActivity(any()) } doThrow JsonParseException()
|
||||||
|
}
|
||||||
|
val userService = mock<UserService>()
|
||||||
|
val activityPubUserService = mock<ActivityPubUserService>()
|
||||||
|
application {
|
||||||
|
configureStatusPages()
|
||||||
|
configureSerialization()
|
||||||
|
configureRouting(httpSignatureVerifyService, activityPubService, userService, activityPubUserService)
|
||||||
|
}
|
||||||
|
client.post("/users/test/inbox").let {
|
||||||
|
Assertions.assertEquals(HttpStatusCode.BadRequest, it.status)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue