style: テストのスタイルを修正

This commit is contained in:
usbharu 2023-05-03 16:53:26 +09:00
parent ad26369346
commit 17e574feca
Signed by: usbharu
GPG Key ID: 6556747BF94EEBC8
3 changed files with 4 additions and 19 deletions

View File

@ -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) {
}

View File

@ -211,7 +211,6 @@ class SecurityKtTest {
Config.configData = ConfigData(url = "https://localhost", objectMapper = jacksonObjectMapper()) Config.configData = ConfigData(url = "https://localhost", objectMapper = jacksonObjectMapper())
val now = Instant.now() val now = Instant.now()
val kid = UUID.randomUUID() val kid = UUID.randomUUID()
val token = JWT.create() val token = JWT.create()
@ -231,7 +230,6 @@ class SecurityKtTest {
) )
} }
val readValue = Config.configData.objectMapper.readerFor(Map::class.java) val readValue = Config.configData.objectMapper.readerFor(Map::class.java)
.readValue<MutableMap<String, Any>?>( .readValue<MutableMap<String, Any>?>(
JsonWebKeyUtil.publicKeyToJwk( JsonWebKeyUtil.publicKeyToJwk(
@ -273,7 +271,6 @@ class SecurityKtTest {
Config.configData = ConfigData(url = "https://localhost", objectMapper = jacksonObjectMapper()) Config.configData = ConfigData(url = "https://localhost", objectMapper = jacksonObjectMapper())
val now = Instant.now() val now = Instant.now()
val kid = UUID.randomUUID() val kid = UUID.randomUUID()
val token = JWT.create() val token = JWT.create()
@ -293,7 +290,6 @@ class SecurityKtTest {
) )
} }
val readValue = Config.configData.objectMapper.readerFor(Map::class.java) val readValue = Config.configData.objectMapper.readerFor(Map::class.java)
.readValue<MutableMap<String, Any>?>( .readValue<MutableMap<String, Any>?>(
JsonWebKeyUtil.publicKeyToJwk( JsonWebKeyUtil.publicKeyToJwk(
@ -333,7 +329,6 @@ class SecurityKtTest {
Config.configData = ConfigData(url = "https://localhost", objectMapper = jacksonObjectMapper()) Config.configData = ConfigData(url = "https://localhost", objectMapper = jacksonObjectMapper())
val now = Instant.now() val now = Instant.now()
val kid = UUID.randomUUID() val kid = UUID.randomUUID()
val token = JWT.create() val token = JWT.create()
@ -353,7 +348,6 @@ class SecurityKtTest {
) )
} }
val readValue = Config.configData.objectMapper.readerFor(Map::class.java) val readValue = Config.configData.objectMapper.readerFor(Map::class.java)
.readValue<MutableMap<String, Any>?>( .readValue<MutableMap<String, Any>?>(
JsonWebKeyUtil.publicKeyToJwk( JsonWebKeyUtil.publicKeyToJwk(
@ -393,7 +387,6 @@ class SecurityKtTest {
Config.configData = ConfigData(url = "https://localhost", objectMapper = jacksonObjectMapper()) Config.configData = ConfigData(url = "https://localhost", objectMapper = jacksonObjectMapper())
val now = Instant.now() val now = Instant.now()
val kid = UUID.randomUUID() val kid = UUID.randomUUID()
val token = JWT.create() val token = JWT.create()
@ -413,7 +406,6 @@ class SecurityKtTest {
) )
} }
val readValue = Config.configData.objectMapper.readerFor(Map::class.java) val readValue = Config.configData.objectMapper.readerFor(Map::class.java)
.readValue<MutableMap<String, Any>?>( .readValue<MutableMap<String, Any>?>(
JsonWebKeyUtil.publicKeyToJwk( JsonWebKeyUtil.publicKeyToJwk(
@ -453,7 +445,6 @@ class SecurityKtTest {
Config.configData = ConfigData(url = "https://localhost", objectMapper = jacksonObjectMapper()) Config.configData = ConfigData(url = "https://localhost", objectMapper = jacksonObjectMapper())
val now = Instant.now() val now = Instant.now()
val kid = UUID.randomUUID() val kid = UUID.randomUUID()
val token = JWT.create() val token = JWT.create()
@ -472,7 +463,6 @@ class SecurityKtTest {
) )
} }
val readValue = Config.configData.objectMapper.readerFor(Map::class.java) val readValue = Config.configData.objectMapper.readerFor(Map::class.java)
.readValue<MutableMap<String, Any>?>( .readValue<MutableMap<String, Any>?>(
JsonWebKeyUtil.publicKeyToJwk( JsonWebKeyUtil.publicKeyToJwk(

View File

@ -42,7 +42,8 @@ class JwtServiceImplTest {
val metaService = mock<IMetaService> { val metaService = mock<IMetaService> {
onBlocking { getJwtMeta() } doReturn Jwt( onBlocking { getJwtMeta() } doReturn Jwt(
kid, kid,
Base64Util.encode(generateKeyPair.private.encoded), Base64Util.encode(generateKeyPair.public.encoded) Base64Util.encode(generateKeyPair.private.encoded),
Base64Util.encode(generateKeyPair.public.encoded)
) )
} }
val refreshTokenRepository = mock<IJwtRefreshTokenRepository> { val refreshTokenRepository = mock<IJwtRefreshTokenRepository> {
@ -119,7 +120,8 @@ class JwtServiceImplTest {
val metaService = mock<IMetaService> { val metaService = mock<IMetaService> {
onBlocking { getJwtMeta() } doReturn Jwt( onBlocking { getJwtMeta() } doReturn Jwt(
kid, 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) val jwtService = JwtServiceImpl(metaService, refreshTokenRepository, userService)