From 17e574feca87c111e5998bffa91af646bb041b33 Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Wed, 3 May 2023 16:53:26 +0900 Subject: [PATCH] =?UTF-8?q?style:=20=E3=83=86=E3=82=B9=E3=83=88=E3=81=AE?= =?UTF-8?q?=E3=82=B9=E3=82=BF=E3=82=A4=E3=83=AB=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kotlin/dev/usbharu/hideout/routing/LoginRouting.kt | 7 ------- .../dev/usbharu/hideout/plugins/SecurityKtTest.kt | 10 ---------- .../dev/usbharu/hideout/service/JwtServiceImplTest.kt | 6 ++++-- 3 files changed, 4 insertions(+), 19 deletions(-) delete mode 100644 src/main/kotlin/dev/usbharu/hideout/routing/LoginRouting.kt diff --git a/src/main/kotlin/dev/usbharu/hideout/routing/LoginRouting.kt b/src/main/kotlin/dev/usbharu/hideout/routing/LoginRouting.kt deleted file mode 100644 index 0a8b9a26..00000000 --- a/src/main/kotlin/dev/usbharu/hideout/routing/LoginRouting.kt +++ /dev/null @@ -1,7 +0,0 @@ -package dev.usbharu.hideout.routing - -import dev.usbharu.hideout.service.IUserAuthService -import io.ktor.server.routing.* - -fun Routing.login(userAuthService: IUserAuthService) { -} diff --git a/src/test/kotlin/dev/usbharu/hideout/plugins/SecurityKtTest.kt b/src/test/kotlin/dev/usbharu/hideout/plugins/SecurityKtTest.kt index 32473173..9c558f36 100644 --- a/src/test/kotlin/dev/usbharu/hideout/plugins/SecurityKtTest.kt +++ b/src/test/kotlin/dev/usbharu/hideout/plugins/SecurityKtTest.kt @@ -211,7 +211,6 @@ class SecurityKtTest { Config.configData = ConfigData(url = "https://localhost", objectMapper = jacksonObjectMapper()) - val now = Instant.now() val kid = UUID.randomUUID() val token = JWT.create() @@ -231,7 +230,6 @@ class SecurityKtTest { ) } - val readValue = Config.configData.objectMapper.readerFor(Map::class.java) .readValue?>( JsonWebKeyUtil.publicKeyToJwk( @@ -273,7 +271,6 @@ class SecurityKtTest { Config.configData = ConfigData(url = "https://localhost", objectMapper = jacksonObjectMapper()) - val now = Instant.now() val kid = UUID.randomUUID() val token = JWT.create() @@ -293,7 +290,6 @@ class SecurityKtTest { ) } - val readValue = Config.configData.objectMapper.readerFor(Map::class.java) .readValue?>( JsonWebKeyUtil.publicKeyToJwk( @@ -333,7 +329,6 @@ class SecurityKtTest { Config.configData = ConfigData(url = "https://localhost", objectMapper = jacksonObjectMapper()) - val now = Instant.now() val kid = UUID.randomUUID() val token = JWT.create() @@ -353,7 +348,6 @@ class SecurityKtTest { ) } - val readValue = Config.configData.objectMapper.readerFor(Map::class.java) .readValue?>( JsonWebKeyUtil.publicKeyToJwk( @@ -393,7 +387,6 @@ class SecurityKtTest { Config.configData = ConfigData(url = "https://localhost", objectMapper = jacksonObjectMapper()) - val now = Instant.now() val kid = UUID.randomUUID() val token = JWT.create() @@ -413,7 +406,6 @@ class SecurityKtTest { ) } - val readValue = Config.configData.objectMapper.readerFor(Map::class.java) .readValue?>( JsonWebKeyUtil.publicKeyToJwk( @@ -453,7 +445,6 @@ class SecurityKtTest { Config.configData = ConfigData(url = "https://localhost", objectMapper = jacksonObjectMapper()) - val now = Instant.now() val kid = UUID.randomUUID() val token = JWT.create() @@ -472,7 +463,6 @@ class SecurityKtTest { ) } - val readValue = Config.configData.objectMapper.readerFor(Map::class.java) .readValue?>( JsonWebKeyUtil.publicKeyToJwk( diff --git a/src/test/kotlin/dev/usbharu/hideout/service/JwtServiceImplTest.kt b/src/test/kotlin/dev/usbharu/hideout/service/JwtServiceImplTest.kt index 6faa4416..7c4f90bb 100644 --- a/src/test/kotlin/dev/usbharu/hideout/service/JwtServiceImplTest.kt +++ b/src/test/kotlin/dev/usbharu/hideout/service/JwtServiceImplTest.kt @@ -42,7 +42,8 @@ class JwtServiceImplTest { val metaService = mock { onBlocking { getJwtMeta() } doReturn Jwt( kid, - Base64Util.encode(generateKeyPair.private.encoded), Base64Util.encode(generateKeyPair.public.encoded) + Base64Util.encode(generateKeyPair.private.encoded), + Base64Util.encode(generateKeyPair.public.encoded) ) } val refreshTokenRepository = mock { @@ -119,7 +120,8 @@ class JwtServiceImplTest { val metaService = mock { onBlocking { getJwtMeta() } doReturn Jwt( kid, - Base64Util.encode(generateKeyPair.private.encoded), Base64Util.encode(generateKeyPair.public.encoded) + Base64Util.encode(generateKeyPair.private.encoded), + Base64Util.encode(generateKeyPair.public.encoded) ) } val jwtService = JwtServiceImpl(metaService, refreshTokenRepository, userService)