style: style

This commit is contained in:
usbharu 2024-09-11 05:57:17 +09:00
parent 5c554bfa16
commit bf2dbf159a
Signed by: usbharu
GPG Key ID: 6556747BF94EEBC8
1 changed files with 17 additions and 79 deletions

View File

@ -38,35 +38,7 @@ class UserDetailRepositoryImplTest : AbstractRepositoryTest(UserDetails) {
dbSetup(to = dataSource) { dbSetup(to = dataSource) {
execute(disableReferenceIntegrityConstraints) execute(disableReferenceIntegrityConstraints)
insertInto("public.actors") { insertInto("public.actors") {
columns( columns(Actors.columns)
"id",
"name",
"domain",
"screen_name",
"description",
"inbox",
"outbox",
"url",
"public_key",
"private_key",
"created_at",
"key_id",
"following",
"followers",
"instance",
"locked",
"following_count",
"followers_count",
"posts_count",
"last_post_at",
"last_update_at",
"suspend",
"move_to",
"emojis",
"deleted",
"icon",
"banner"
)
values( values(
1, 1,
"b", "b",
@ -111,13 +83,9 @@ class UserDetailRepositoryImplTest : AbstractRepositoryTest(UserDetails) {
) )
) )
assertThat(assertTable) assertThat(assertTable).row(0).isEqualTo(UserDetails.id, 1).isEqualTo(UserDetails.actorId, 1)
.row(0)
.isEqualTo(UserDetails.id, 1)
.isEqualTo(UserDetails.actorId, 1)
.isEqualTo(UserDetails.password, "VeeeeeeeeeeeeeryStrongPassword") .isEqualTo(UserDetails.password, "VeeeeeeeeeeeeeryStrongPassword")
.isEqualTo(UserDetails.lastMigration, null) .isEqualTo(UserDetails.lastMigration, null).isEqualTo(UserDetails.autoAcceptFolloweeFollowRequest, false)
.isEqualTo(UserDetails.autoAcceptFolloweeFollowRequest, false)
.isEqualTo(UserDetails.homeTimelineId, null) .isEqualTo(UserDetails.homeTimelineId, null)
} }
@ -126,9 +94,7 @@ class UserDetailRepositoryImplTest : AbstractRepositoryTest(UserDetails) {
dbSetup(to = dataSource) { dbSetup(to = dataSource) {
execute(disableReferenceIntegrityConstraints) execute(disableReferenceIntegrityConstraints)
insertInto("public.actors") { insertInto("public.actors") {
columns( columns(Actors.columns)
Actors.columns
)
values( values(
1, 1,
"b", "b",
@ -160,9 +126,7 @@ class UserDetailRepositoryImplTest : AbstractRepositoryTest(UserDetails) {
) )
} }
insertInto("public.user_details") { insertInto("public.user_details") {
columns( columns(UserDetails.columns)
UserDetails.columns
)
values( values(
1, 1,
1, 1,
@ -186,13 +150,9 @@ class UserDetailRepositoryImplTest : AbstractRepositoryTest(UserDetails) {
) )
) )
assertThat(assertTable) assertThat(assertTable).row(0).isEqualTo(UserDetails.id, 1).isEqualTo(UserDetails.actorId, 1)
.row(0)
.isEqualTo(UserDetails.id, 1)
.isEqualTo(UserDetails.actorId, 1)
.isEqualTo(UserDetails.password, "VeeeeeeeeeeeeeryStrongPassword") .isEqualTo(UserDetails.password, "VeeeeeeeeeeeeeryStrongPassword")
.isEqualTo(UserDetails.lastMigration, null) .isEqualTo(UserDetails.lastMigration, null).isEqualTo(UserDetails.autoAcceptFolloweeFollowRequest, false)
.isEqualTo(UserDetails.autoAcceptFolloweeFollowRequest, false)
.isEqualTo(UserDetails.homeTimelineId, null) .isEqualTo(UserDetails.homeTimelineId, null)
} }
@ -201,9 +161,7 @@ class UserDetailRepositoryImplTest : AbstractRepositoryTest(UserDetails) {
dbSetup(to = dataSource) { dbSetup(to = dataSource) {
execute(disableReferenceIntegrityConstraints) execute(disableReferenceIntegrityConstraints)
insertInto("public.user_details") { insertInto("public.user_details") {
columns( columns(UserDetails.columns)
UserDetails.columns
)
values( values(
1, 1,
1, 1,
@ -217,22 +175,15 @@ class UserDetailRepositoryImplTest : AbstractRepositoryTest(UserDetails) {
}.launch() }.launch()
val userDetail = UserDetail( val userDetail = UserDetail(
UserDetailId(1), UserDetailId(1), ActorId(1), UserDetailHashedPassword("VeeeeeeeeeeeeeryStrongPassword"), false, null, null
ActorId(1),
UserDetailHashedPassword("VeeeeeeeeeeeeeryStrongPassword"),
false,
null,
null
) )
change.withSuspend { change.withSuspend {
userDetailRepository.delete(userDetail) userDetailRepository.delete(userDetail)
} }
assertThat(change) assertThat(change).changeOfDeletionOnTable(UserDetails.tableName).rowAtStartPoint().value(UserDetails.id.name)
.changeOfDeletionOnTable(UserDetails.tableName) .isEqualTo(1)
.rowAtStartPoint()
.value(UserDetails.id.name).isEqualTo(1)
} }
@Test @Test
@ -240,9 +191,7 @@ class UserDetailRepositoryImplTest : AbstractRepositoryTest(UserDetails) {
dbSetup(to = dataSource) { dbSetup(to = dataSource) {
execute(disableReferenceIntegrityConstraints) execute(disableReferenceIntegrityConstraints)
insertInto("public.user_details") { insertInto("public.user_details") {
columns( columns(UserDetails.columns)
UserDetails.columns
)
values( values(
1, 1,
1, 1,
@ -279,9 +228,7 @@ class UserDetailRepositoryImplTest : AbstractRepositoryTest(UserDetails) {
dbSetup(to = dataSource) { dbSetup(to = dataSource) {
execute(disableReferenceIntegrityConstraints) execute(disableReferenceIntegrityConstraints)
insertInto("public.user_details") { insertInto("public.user_details") {
columns( columns(UserDetails.columns)
UserDetails.columns
)
values( values(
1, 1,
1, 1,
@ -318,16 +265,9 @@ class UserDetailRepositoryImplTest : AbstractRepositoryTest(UserDetails) {
dbSetup(to = dataSource) { dbSetup(to = dataSource) {
execute(disableReferenceIntegrityConstraints) execute(disableReferenceIntegrityConstraints)
insertInto("public.user_details") { insertInto("public.user_details") {
columns( columns(UserDetails.columns)
UserDetails.columns
)
values( values(
1, 1, 1, "$2a$10\$EBj3lstVOv0wz3CxLpzYJu8FFrUJ2MPJW9Vlklyg.bfGEOn5sqIwm", false, null, null
1,
"$2a$10\$EBj3lstVOv0wz3CxLpzYJu8FFrUJ2MPJW9Vlklyg.bfGEOn5sqIwm",
false,
null,
null
) )
values( values(
2, 2,
@ -351,8 +291,7 @@ class UserDetailRepositoryImplTest : AbstractRepositoryTest(UserDetails) {
val userDetailList = userDetailRepository.findAllById(listOf(UserDetailId(1), UserDetailId(3))) val userDetailList = userDetailRepository.findAllById(listOf(UserDetailId(1), UserDetailId(3)))
assertThat(userDetailList) assertThat(userDetailList).hasSize(2)
.hasSize(2)
} }
@Test @Test
@ -414,8 +353,7 @@ class UserDetailRepositoryImplTest : AbstractRepositoryTest(UserDetails) {
} }
private fun assertEquals( private fun assertEquals(
actual: UserDetail?, actual: UserDetail?, expect: UserDetail
expect: UserDetail
) { ) {
assertNotNull(actual) assertNotNull(actual)
kotlin.test.assertEquals(expect, actual) kotlin.test.assertEquals(expect, actual)