test: rejectFollowRequestのテストを修正

This commit is contained in:
usbharu 2023-12-11 12:43:27 +09:00
parent 31e69f8141
commit 35d957567c
1 changed files with 13 additions and 13 deletions

View File

@ -412,10 +412,10 @@ class RelationshipServiceImplTest {
fun `rejectFollowRequest ローカルユーザーの場合永続化される`() = runTest { fun `rejectFollowRequest ローカルユーザーの場合永続化される`() = runTest {
whenever(userQueryService.findById(eq(5678))).doReturn(UserBuilder.localUserOf(domain = "example.com")) whenever(userQueryService.findById(eq(5678))).doReturn(UserBuilder.localUserOf(domain = "example.com"))
whenever(relationshipRepository.findByUserIdAndTargetUserId(eq(1234), eq(5678))).doReturn( whenever(relationshipRepository.findByUserIdAndTargetUserId(eq(5678), eq(1234))).doReturn(
Relationship( Relationship(
userId = 1234, userId = 5678,
targetUserId = 5678, targetUserId = 1234,
following = false, following = false,
blocking = false, blocking = false,
muting = false, muting = false,
@ -429,8 +429,8 @@ class RelationshipServiceImplTest {
verify(relationshipRepository, times(1)).save( verify(relationshipRepository, times(1)).save(
eq( eq(
Relationship( Relationship(
userId = 1234, userId = 5678,
targetUserId = 5678, targetUserId = 1234,
following = false, following = false,
blocking = false, blocking = false,
muting = false, muting = false,
@ -451,10 +451,10 @@ class RelationshipServiceImplTest {
val remoteUser = UserBuilder.remoteUserOf(domain = "remote.example.com") val remoteUser = UserBuilder.remoteUserOf(domain = "remote.example.com")
whenever(userQueryService.findById(eq(5678))).doReturn(remoteUser) whenever(userQueryService.findById(eq(5678))).doReturn(remoteUser)
whenever(relationshipRepository.findByUserIdAndTargetUserId(eq(1234), eq(5678))).doReturn( whenever(relationshipRepository.findByUserIdAndTargetUserId(eq(5678), eq(1234))).doReturn(
Relationship( Relationship(
userId = 1234, userId = 5678,
targetUserId = 5678, targetUserId = 1234,
following = false, following = false,
blocking = false, blocking = false,
muting = false, muting = false,
@ -468,8 +468,8 @@ class RelationshipServiceImplTest {
verify(relationshipRepository, times(1)).save( verify(relationshipRepository, times(1)).save(
eq( eq(
Relationship( Relationship(
userId = 1234, userId = 5678,
targetUserId = 5678, targetUserId = 1234,
following = false, following = false,
blocking = false, blocking = false,
muting = false, muting = false,
@ -492,10 +492,10 @@ class RelationshipServiceImplTest {
@Test @Test
fun `rejectFollowRequest フォローリクエストが存在しない場合何もしない`() = runTest { fun `rejectFollowRequest フォローリクエストが存在しない場合何もしない`() = runTest {
whenever(relationshipRepository.findByUserIdAndTargetUserId(eq(1234), eq(5678))).doReturn( whenever(relationshipRepository.findByUserIdAndTargetUserId(eq(5678), eq(1234))).doReturn(
Relationship( Relationship(
userId = 1234, userId = 5678,
targetUserId = 5678, targetUserId = 1234,
following = false, following = false,
blocking = false, blocking = false,
muting = false, muting = false,