mirror of https://github.com/usbharu/Hideout.git
test: テストを修正
This commit is contained in:
parent
37db201f87
commit
d163fc0948
|
@ -111,6 +111,5 @@ class ActivityPubUserServiceImpl(
|
||||||
)
|
)
|
||||||
person
|
person
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ import org.junit.jupiter.api.Test
|
||||||
import org.mockito.kotlin.any
|
import org.mockito.kotlin.any
|
||||||
import org.mockito.kotlin.doAnswer
|
import org.mockito.kotlin.doAnswer
|
||||||
import org.mockito.kotlin.mock
|
import org.mockito.kotlin.mock
|
||||||
|
import utils.TestTransaction
|
||||||
import java.security.KeyPairGenerator
|
import java.security.KeyPairGenerator
|
||||||
import java.time.Instant
|
import java.time.Instant
|
||||||
|
|
||||||
|
@ -40,7 +41,7 @@ class ActivityPubKtTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
runBlocking {
|
runBlocking {
|
||||||
val ktorKeyMap = KtorKeyMap(userQueryService)
|
val ktorKeyMap = KtorKeyMap(userQueryService, TestTransaction)
|
||||||
|
|
||||||
val httpClient = HttpClient(
|
val httpClient = HttpClient(
|
||||||
MockEngine { httpRequestData ->
|
MockEngine { httpRequestData ->
|
||||||
|
|
|
@ -7,6 +7,7 @@ import org.junit.jupiter.api.Test
|
||||||
import org.mockito.kotlin.any
|
import org.mockito.kotlin.any
|
||||||
import org.mockito.kotlin.doAnswer
|
import org.mockito.kotlin.doAnswer
|
||||||
import org.mockito.kotlin.mock
|
import org.mockito.kotlin.mock
|
||||||
|
import utils.TestTransaction
|
||||||
import java.security.KeyPairGenerator
|
import java.security.KeyPairGenerator
|
||||||
import java.time.Instant
|
import java.time.Instant
|
||||||
|
|
||||||
|
@ -35,7 +36,7 @@ class KtorKeyMapTest {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val ktorKeyMap = KtorKeyMap(userQueryService)
|
val ktorKeyMap = KtorKeyMap(userQueryService, TestTransaction)
|
||||||
|
|
||||||
ktorKeyMap.getPrivateKey("test")
|
ktorKeyMap.getPrivateKey("test")
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,7 @@ import org.junit.jupiter.api.Test
|
||||||
import org.mockito.ArgumentMatchers.anyString
|
import org.mockito.ArgumentMatchers.anyString
|
||||||
import org.mockito.kotlin.*
|
import org.mockito.kotlin.*
|
||||||
import utils.JsonObjectMapper
|
import utils.JsonObjectMapper
|
||||||
|
import utils.TestTransaction
|
||||||
import java.time.Instant
|
import java.time.Instant
|
||||||
|
|
||||||
class ActivityPubReceiveFollowServiceImplTest {
|
class ActivityPubReceiveFollowServiceImplTest {
|
||||||
|
@ -33,7 +34,7 @@ class ActivityPubReceiveFollowServiceImplTest {
|
||||||
onBlocking { schedule(eq(ReceiveFollowJob), any()) } doReturn Unit
|
onBlocking { schedule(eq(ReceiveFollowJob), any()) } doReturn Unit
|
||||||
}
|
}
|
||||||
val activityPubFollowService =
|
val activityPubFollowService =
|
||||||
ActivityPubReceiveFollowServiceImpl(jobQueueParentService, mock(), mock(), mock(), mock())
|
ActivityPubReceiveFollowServiceImpl(jobQueueParentService, mock(), mock(), mock(), mock(), TestTransaction)
|
||||||
activityPubFollowService.receiveFollow(
|
activityPubFollowService.receiveFollow(
|
||||||
Follow(
|
Follow(
|
||||||
emptyList(),
|
emptyList(),
|
||||||
|
@ -161,7 +162,8 @@ class ActivityPubReceiveFollowServiceImplTest {
|
||||||
respondOk()
|
respondOk()
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
userQueryService
|
userQueryService,
|
||||||
|
TestTransaction
|
||||||
)
|
)
|
||||||
activityPubFollowService.receiveFollowJob(
|
activityPubFollowService.receiveFollowJob(
|
||||||
JobProps(
|
JobProps(
|
||||||
|
|
Loading…
Reference in New Issue