style: スタイルを修正

This commit is contained in:
usbharu 2023-06-02 17:31:54 +09:00
parent d141b60ab2
commit d856de526a
Signed by: usbharu
GPG Key ID: 6556747BF94EEBC8
9 changed files with 66 additions and 35 deletions

View File

@ -6,6 +6,6 @@ exposed_version=0.41.1
h2_version=2.1.214 h2_version=2.1.214
koin_version=3.3.1 koin_version=3.3.1
org.gradle.parallel=true org.gradle.parallel=true
#org.gradle.configureondemand=true org.gradle.configureondemand=true
org.gradle.caching=true org.gradle.caching=true
org.gradle.jvmargs=-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC org.gradle.jvmargs=-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC

View File

@ -30,7 +30,8 @@ class UndoTest {
@Test @Test
fun Undoをデシリアライズ出来る() { fun Undoをデシリアライズ出来る() {
@Language("JSON") val json = """ @Language("JSON")
val json = """
{ {
"@context": [ "@context": [
"https://www.w3.org/ns/activitystreams", "https://www.w3.org/ns/activitystreams",

View File

@ -92,6 +92,18 @@ class ActivityPubKtTest {
TODO("Not yet implemented") TODO("Not yet implemented")
} }
override suspend fun addFollowRequest(id: Long, follower: Long) {
TODO("Not yet implemented")
}
override suspend fun deleteFollowRequest(id: Long, follower: Long) {
TODO("Not yet implemented")
}
override suspend fun findFollowRequestsById(id: Long, follower: Long): Boolean {
TODO("Not yet implemented")
}
override suspend fun nextId(): Long { override suspend fun nextId(): Long {
TODO("Not yet implemented") TODO("Not yet implemented")
} }

View File

@ -41,11 +41,14 @@ class JwtRefreshTokenRepositoryImplTest {
@Test @Test
fun `save 存在しない場合はinsertする`() = runTest { fun `save 存在しない場合はinsertする`() = runTest {
val repository = JwtRefreshTokenRepositoryImpl(db, object : IdGenerateService { val repository = JwtRefreshTokenRepositoryImpl(
db,
object : IdGenerateService {
override suspend fun generateId(): Long { override suspend fun generateId(): Long {
TODO("Not yet implemented") TODO("Not yet implemented")
} }
}) }
)
val now = Instant.now(Clock.tickMillis(ZoneId.systemDefault())) val now = Instant.now(Clock.tickMillis(ZoneId.systemDefault()))
val expiresAt = now.plus(10, ChronoUnit.MINUTES) val expiresAt = now.plus(10, ChronoUnit.MINUTES)
@ -57,11 +60,14 @@ class JwtRefreshTokenRepositoryImplTest {
@Test @Test
fun `save 存在する場合はupdateする`() = runTest { fun `save 存在する場合はupdateする`() = runTest {
val repository = JwtRefreshTokenRepositoryImpl(db, object : IdGenerateService { val repository = JwtRefreshTokenRepositoryImpl(
db,
object : IdGenerateService {
override suspend fun generateId(): Long { override suspend fun generateId(): Long {
TODO("Not yet implemented") TODO("Not yet implemented")
} }
}) }
)
transaction { transaction {
JwtRefreshTokens.insert { JwtRefreshTokens.insert {
it[id] = 1L it[id] = 1L

View File

@ -158,8 +158,12 @@ class PostsTest {
config = ApplicationConfig("empty.conf") config = ApplicationConfig("empty.conf")
} }
val post = Post( val post = Post(
12345, 1234, text = "aaa", visibility = Visibility.PUBLIC, 12345,
createdAt = Instant.now().toEpochMilli(), url = "https://example.com/posts/1" 1234,
text = "aaa",
visibility = Visibility.PUBLIC,
createdAt = Instant.now().toEpochMilli(),
url = "https://example.com/posts/1"
) )
val postService = mock<IPostService> { val postService = mock<IPostService> {
onBlocking { findByIdForUser(any(), anyOrNull()) } doReturn post onBlocking { findByIdForUser(any(), anyOrNull()) } doReturn post
@ -185,8 +189,12 @@ class PostsTest {
config = ApplicationConfig("empty.conf") config = ApplicationConfig("empty.conf")
} }
val post = Post( val post = Post(
12345, 1234, text = "aaa", visibility = Visibility.FOLLOWERS, 12345,
createdAt = Instant.now().toEpochMilli(), url = "https://example.com/posts/1" 1234,
text = "aaa",
visibility = Visibility.FOLLOWERS,
createdAt = Instant.now().toEpochMilli(),
url = "https://example.com/posts/1"
) )
val postService = mock<IPostService> { val postService = mock<IPostService> {
onBlocking { findByIdForUser(any(), isNotNull()) } doReturn post onBlocking { findByIdForUser(any(), isNotNull()) } doReturn post
@ -247,7 +255,6 @@ class PostsTest {
} }
application { application {
authentication { authentication {
bearer(TOKEN_AUTH) { bearer(TOKEN_AUTH) {
authenticate { authenticate {
println("aaaaaaaaaaaa") println("aaaaaaaaaaaa")

View File

@ -290,7 +290,8 @@ class UsersTest {
"test User", "test User",
"https://example.com/test", "https://example.com/test",
Instant.now().toEpochMilli() Instant.now().toEpochMilli()
), UserResponse( ),
UserResponse(
1236, 1236,
"follower2", "follower2",
"example.com", "example.com",
@ -334,7 +335,8 @@ class UsersTest {
"test User", "test User",
"https://example.com/test", "https://example.com/test",
Instant.now().toEpochMilli() Instant.now().toEpochMilli()
), UserResponse( ),
UserResponse(
1236, 1236,
"follower2", "follower2",
"example.com", "example.com",
@ -378,7 +380,8 @@ class UsersTest {
"test User", "test User",
"https://example.com/test", "https://example.com/test",
Instant.now().toEpochMilli() Instant.now().toEpochMilli()
), UserResponse( ),
UserResponse(
1236, 1236,
"follower2", "follower2",
"example.com", "example.com",
@ -572,7 +575,8 @@ class UsersTest {
"test User", "test User",
"https://example.com/test", "https://example.com/test",
Instant.now().toEpochMilli() Instant.now().toEpochMilli()
), UserResponse( ),
UserResponse(
1236, 1236,
"follower2", "follower2",
"example.com", "example.com",
@ -616,7 +620,8 @@ class UsersTest {
"test User", "test User",
"https://example.com/test", "https://example.com/test",
Instant.now().toEpochMilli() Instant.now().toEpochMilli()
), UserResponse( ),
UserResponse(
1236, 1236,
"follower2", "follower2",
"example.com", "example.com",
@ -660,7 +665,8 @@ class UsersTest {
"test User", "test User",
"https://example.com/test", "https://example.com/test",
Instant.now().toEpochMilli() Instant.now().toEpochMilli()
), UserResponse( ),
UserResponse(
1236, 1236,
"follower2", "follower2",
"example.com", "example.com",

View File

@ -37,7 +37,6 @@ class MetaServiceImplTest {
@Test @Test
fun `updateMeta メタデータを保存できる`() = runTest { fun `updateMeta メタデータを保存できる`() = runTest {
val meta = Meta("1.0.1", Jwt(UUID.randomUUID(), "sdfsdjk", "adafda")) val meta = Meta("1.0.1", Jwt(UUID.randomUUID(), "sdfsdjk", "adafda"))
val metaRepository = mock<IMetaRepository> { val metaRepository = mock<IMetaRepository> {
onBlocking { save(any()) } doReturn Unit onBlocking { save(any()) } doReturn Unit