From 3764d476c02e534f97bddbde499b8617d6eb7fb9 Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Tue, 8 Aug 2023 17:58:28 +0900 Subject: [PATCH] =?UTF-8?q?test:=20=E3=83=86=E3=82=B9=E3=83=88=E3=81=AE?= =?UTF-8?q?=E5=9E=8B=E3=82=A8=E3=83=A9=E3=83=BC=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../routing/api/internal/v1/PostsTest.kt | 66 +++++++++---------- .../routing/api/internal/v1/UsersTest.kt | 42 ++++++------ 2 files changed, 54 insertions(+), 54 deletions(-) diff --git a/src/test/kotlin/dev/usbharu/hideout/routing/api/internal/v1/PostsTest.kt b/src/test/kotlin/dev/usbharu/hideout/routing/api/internal/v1/PostsTest.kt index 2bfc150e..9e2cf132 100644 --- a/src/test/kotlin/dev/usbharu/hideout/routing/api/internal/v1/PostsTest.kt +++ b/src/test/kotlin/dev/usbharu/hideout/routing/api/internal/v1/PostsTest.kt @@ -35,7 +35,7 @@ class PostsTest { config = ApplicationConfig("empty.conf") } val user = UserResponse( - id = 54321, + id = "54321", name = "user1", domain = "example.com", screenName = "user 1", @@ -45,7 +45,7 @@ class PostsTest { ) val posts = listOf( PostResponse( - id = 12345, + id = "12345", user = user, text = "test1", visibility = Visibility.PUBLIC, @@ -53,7 +53,7 @@ class PostsTest { url = "https://example.com/posts/1" ), PostResponse( - id = 123456, + id = "123456", user = user, text = "test2", visibility = Visibility.PUBLIC, @@ -101,7 +101,7 @@ class PostsTest { on { getClaim(eq("uid")) } doReturn claim } val user = UserResponse( - id = 54321, + id = "54321", name = "user1", domain = "example.com", screenName = "user 1", @@ -111,7 +111,7 @@ class PostsTest { ) val posts = listOf( PostResponse( - id = 12345, + id = "12345", user = user, text = "test1", visibility = Visibility.PUBLIC, @@ -119,7 +119,7 @@ class PostsTest { url = "https://example.com/posts/1" ), PostResponse( - id = 123456, + id = "123456", user = user, text = "test2", visibility = Visibility.PUBLIC, @@ -127,7 +127,7 @@ class PostsTest { url = "https://example.com/posts/2" ), PostResponse( - id = 1234567, + id = "1234567", user = user, text = "Followers only", visibility = Visibility.FOLLOWERS, @@ -176,7 +176,7 @@ class PostsTest { config = ApplicationConfig("empty.conf") } val user = UserResponse( - id = 54321, + id = "54321", name = "user1", domain = "example.com", screenName = "user 1", @@ -185,7 +185,7 @@ class PostsTest { createdAt = Instant.now().toEpochMilli() ) val post = PostResponse( - id = 12345, + id = "12345", user = user, text = "aaa", visibility = Visibility.PUBLIC, @@ -216,9 +216,9 @@ class PostsTest { config = ApplicationConfig("empty.conf") } val post = PostResponse( - 12345, + "12345", UserResponse( - id = 54321, + id = "54321", name = "user1", domain = "example.com", screenName = "user 1", @@ -279,9 +279,9 @@ class PostsTest { val argument = it.getArgument(0) val userId = it.getArgument(1) PostResponse( - id = 123L, + id = "123", user = UserResponse( - id = 54321, + id = "54321", name = "user1", domain = "example.com", screenName = "user 1", @@ -335,7 +335,7 @@ class PostsTest { config = ApplicationConfig("empty.conf") } val user = UserResponse( - id = 54321, + id = "54321", name = "user1", domain = "example.com", screenName = "user 1", @@ -345,7 +345,7 @@ class PostsTest { ) val posts = listOf( PostResponse( - id = 12345, + id = "12345", user = user, text = "test1", visibility = Visibility.PUBLIC, @@ -353,7 +353,7 @@ class PostsTest { url = "https://example.com/posts/1" ), PostResponse( - id = 123456, + id = "123456", user = user, text = "test2", visibility = Visibility.PUBLIC, @@ -396,7 +396,7 @@ class PostsTest { config = ApplicationConfig("empty.conf") } val user = UserResponse( - id = 54321, + id = "54321", name = "user1", domain = "example.com", screenName = "user 1", @@ -406,7 +406,7 @@ class PostsTest { ) val posts = listOf( PostResponse( - id = 12345, + id = "12345", user = user, text = "test1", visibility = Visibility.PUBLIC, @@ -414,7 +414,7 @@ class PostsTest { url = "https://example.com/posts/1" ), PostResponse( - id = 123456, + id = "123456", user = user, text = "test2", visibility = Visibility.PUBLIC, @@ -457,7 +457,7 @@ class PostsTest { config = ApplicationConfig("empty.conf") } val user = UserResponse( - id = 54321, + id = "54321", name = "user1", domain = "example.com", screenName = "user 1", @@ -467,7 +467,7 @@ class PostsTest { ) val posts = listOf( PostResponse( - id = 12345, + id = "12345", user = user, text = "test1", visibility = Visibility.PUBLIC, @@ -475,7 +475,7 @@ class PostsTest { url = "https://example.com/posts/1" ), PostResponse( - id = 123456, + id = "123456", user = user, text = "test2", visibility = Visibility.PUBLIC, @@ -518,7 +518,7 @@ class PostsTest { config = ApplicationConfig("empty.conf") } val user = UserResponse( - id = 54321, + id = "54321", name = "user1", domain = "example.com", screenName = "user 1", @@ -528,7 +528,7 @@ class PostsTest { ) val posts = listOf( PostResponse( - id = 12345, + id = "12345", user = user, text = "test1", visibility = Visibility.PUBLIC, @@ -536,7 +536,7 @@ class PostsTest { url = "https://example.com/posts/1" ), PostResponse( - id = 123456, + id = "123456", user = user, text = "test2", visibility = Visibility.PUBLIC, @@ -579,9 +579,9 @@ class PostsTest { config = ApplicationConfig("empty.conf") } val post = PostResponse( - id = 123456, + id = "123456", user = UserResponse( - id = 54321, + id = "54321", name = "user1", domain = "example.com", screenName = "user 1", @@ -619,9 +619,9 @@ class PostsTest { config = ApplicationConfig("empty.conf") } val post = PostResponse( - id = 123456, + id = "123456", user = UserResponse( - id = 54321, + id = "54321", name = "user1", domain = "example.com", screenName = "user 1", @@ -659,9 +659,9 @@ class PostsTest { config = ApplicationConfig("empty.conf") } val post = PostResponse( - id = 123456, + id = "123456", user = UserResponse( - id = 54321, + id = "54321", name = "user1", domain = "example.com", screenName = "user 1", @@ -699,9 +699,9 @@ class PostsTest { config = ApplicationConfig("empty.conf") } val post = PostResponse( - id = 123456, + id = "123456", user = UserResponse( - id = 54321, + id = "54321", name = "user1", domain = "example.com", screenName = "user 1", diff --git a/src/test/kotlin/dev/usbharu/hideout/routing/api/internal/v1/UsersTest.kt b/src/test/kotlin/dev/usbharu/hideout/routing/api/internal/v1/UsersTest.kt index c9fdf8fd..a29245df 100644 --- a/src/test/kotlin/dev/usbharu/hideout/routing/api/internal/v1/UsersTest.kt +++ b/src/test/kotlin/dev/usbharu/hideout/routing/api/internal/v1/UsersTest.kt @@ -35,7 +35,7 @@ class UsersTest { val users = listOf( UserResponse( - 12345, + "12345", "test1", "example.com", "test", @@ -44,7 +44,7 @@ class UsersTest { Instant.now().toEpochMilli() ), UserResponse( - 12343, + "12343", "tes2", "example.com", "test", @@ -149,7 +149,7 @@ class UsersTest { config = ApplicationConfig("empty.conf") } val userResponse = UserResponse( - 1234, + "1234", "test1", "example.com", "test", @@ -182,7 +182,7 @@ class UsersTest { config = ApplicationConfig("empty.conf") } val userResponse = UserResponse( - 1234, + "1234", "test1", "example.com", "test", @@ -215,7 +215,7 @@ class UsersTest { config = ApplicationConfig("empty.conf") } val userResponse = UserResponse( - 1234, + "1234", "test1", "example.com", "test", @@ -248,7 +248,7 @@ class UsersTest { config = ApplicationConfig("empty.conf") } val userResponse = UserResponse( - 1234, + "1234", "test1", "example.com", "test", @@ -283,7 +283,7 @@ class UsersTest { val followers = listOf( UserResponse( - 1235, + "1235", "follower1", "example.com", "test", @@ -292,7 +292,7 @@ class UsersTest { Instant.now().toEpochMilli() ), UserResponse( - 1236, + "1236", "follower2", "example.com", "test", @@ -328,7 +328,7 @@ class UsersTest { val followers = listOf( UserResponse( - 1235, + "1235", "follower1", "example.com", "test", @@ -337,7 +337,7 @@ class UsersTest { Instant.now().toEpochMilli() ), UserResponse( - 1236, + "1236", "follower2", "example.com", "test", @@ -373,7 +373,7 @@ class UsersTest { val followers = listOf( UserResponse( - 1235, + "1235", "follower1", "example.com", "test", @@ -382,7 +382,7 @@ class UsersTest { Instant.now().toEpochMilli() ), UserResponse( - 1236, + "1236", "follower2", "example.com", "test", @@ -425,7 +425,7 @@ class UsersTest { val userApiService = mock { onBlocking { findByAcct(any()) } doReturn UserResponse( - 1235, + "1235", "follower1", "example.com", "test", @@ -475,7 +475,7 @@ class UsersTest { val userApiService = mock { onBlocking { findByAcct(any()) } doReturn UserResponse( - 1235, + "1235", "follower1", "example.com", "test", @@ -525,7 +525,7 @@ class UsersTest { val userApiService = mock { onBlocking { findById(any()) } doReturn UserResponse( - 1235, + "1235", "follower1", "example.com", "test", @@ -568,7 +568,7 @@ class UsersTest { val followers = listOf( UserResponse( - 1235, + "1235", "follower1", "example.com", "test", @@ -577,7 +577,7 @@ class UsersTest { Instant.now().toEpochMilli() ), UserResponse( - 1236, + "1236", "follower2", "example.com", "test", @@ -613,7 +613,7 @@ class UsersTest { val followers = listOf( UserResponse( - 1235, + "1235", "follower1", "example.com", "test", @@ -622,7 +622,7 @@ class UsersTest { Instant.now().toEpochMilli() ), UserResponse( - 1236, + "1236", "follower2", "example.com", "test", @@ -658,7 +658,7 @@ class UsersTest { val followers = listOf( UserResponse( - 1235, + "1235", "follower1", "example.com", "test", @@ -667,7 +667,7 @@ class UsersTest { Instant.now().toEpochMilli() ), UserResponse( - 1236, + "1236", "follower2", "example.com", "test",