mirror of https://github.com/usbharu/Hideout.git
test: ユーザーのinboxのPOSTのテストを追加
This commit is contained in:
parent
31e4218ef8
commit
2a3db9dddc
|
@ -70,4 +70,27 @@ class InboxRoutingKtTest {
|
|||
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