test: テストを修正

This commit is contained in:
usbharu 2023-08-11 15:58:53 +09:00
parent 37db201f87
commit d163fc0948
4 changed files with 8 additions and 5 deletions

View File

@ -111,6 +111,5 @@ class ActivityPubUserServiceImpl(
)
person
}
}
}

View File

@ -12,6 +12,7 @@ import org.junit.jupiter.api.Test
import org.mockito.kotlin.any
import org.mockito.kotlin.doAnswer
import org.mockito.kotlin.mock
import utils.TestTransaction
import java.security.KeyPairGenerator
import java.time.Instant
@ -40,7 +41,7 @@ class ActivityPubKtTest {
}
}
runBlocking {
val ktorKeyMap = KtorKeyMap(userQueryService)
val ktorKeyMap = KtorKeyMap(userQueryService, TestTransaction)
val httpClient = HttpClient(
MockEngine { httpRequestData ->

View File

@ -7,6 +7,7 @@ import org.junit.jupiter.api.Test
import org.mockito.kotlin.any
import org.mockito.kotlin.doAnswer
import org.mockito.kotlin.mock
import utils.TestTransaction
import java.security.KeyPairGenerator
import java.time.Instant
@ -35,7 +36,7 @@ class KtorKeyMapTest {
)
}
}
val ktorKeyMap = KtorKeyMap(userQueryService)
val ktorKeyMap = KtorKeyMap(userQueryService, TestTransaction)
ktorKeyMap.getPrivateKey("test")
}

View File

@ -24,6 +24,7 @@ import org.junit.jupiter.api.Test
import org.mockito.ArgumentMatchers.anyString
import org.mockito.kotlin.*
import utils.JsonObjectMapper
import utils.TestTransaction
import java.time.Instant
class ActivityPubReceiveFollowServiceImplTest {
@ -33,7 +34,7 @@ class ActivityPubReceiveFollowServiceImplTest {
onBlocking { schedule(eq(ReceiveFollowJob), any()) } doReturn Unit
}
val activityPubFollowService =
ActivityPubReceiveFollowServiceImpl(jobQueueParentService, mock(), mock(), mock(), mock())
ActivityPubReceiveFollowServiceImpl(jobQueueParentService, mock(), mock(), mock(), mock(), TestTransaction)
activityPubFollowService.receiveFollow(
Follow(
emptyList(),
@ -161,7 +162,8 @@ class ActivityPubReceiveFollowServiceImplTest {
respondOk()
}
),
userQueryService
userQueryService,
TestTransaction
)
activityPubFollowService.receiveFollowJob(
JobProps(