mirror of https://github.com/usbharu/Hideout.git
style: テストのスタイルを修正
This commit is contained in:
parent
ad26369346
commit
17e574feca
|
@ -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) {
|
|
||||||
}
|
|
|
@ -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(
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue