From c54fcc7aef6267344d7e7c4f1375d987fd54412b Mon Sep 17 00:00:00 2001 From: FyloZ Date: Thu, 2 Dec 2021 21:30:07 -0500 Subject: [PATCH] Update JWT service test --- .../fyloz/colorrecipesexplorer/service/JwtServiceTest.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/kotlin/dev/fyloz/colorrecipesexplorer/service/JwtServiceTest.kt b/src/test/kotlin/dev/fyloz/colorrecipesexplorer/service/JwtServiceTest.kt index e957fad..8a0a241 100644 --- a/src/test/kotlin/dev/fyloz/colorrecipesexplorer/service/JwtServiceTest.kt +++ b/src/test/kotlin/dev/fyloz/colorrecipesexplorer/service/JwtServiceTest.kt @@ -14,6 +14,7 @@ import dev.fyloz.colorrecipesexplorer.utils.isAround import io.jsonwebtoken.Jwts import io.jsonwebtoken.jackson.io.JacksonDeserializer import io.mockk.spyk +import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import java.time.Instant import kotlin.test.assertEquals @@ -36,8 +37,6 @@ class JwtServiceTest { private val user = user() private val userOutputDto = user.toOutputDto() - private val jwt = - "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIwIiwiZXhwIjoxNjM3NTA0NDYyLCJ1c2VyIjoie1wiaWRcIjowLFwiZmlyc3ROYW1lXCI6XCJmaXJzdE5hbWVcIixcImxhc3ROYW1lXCI6XCJsYXN0TmFtZVwiLFwiZ3JvdXBcIjpudWxsLFwicGVybWlzc2lvbnNcIjpbXSxcImV4cGxpY2l0UGVybWlzc2lvbnNcIjpbXSxcImxhc3RMb2dpblRpbWVcIjpudWxsfSJ9.tSU4gzkPIHldfGKwBuMg1qdQTWIA5kOzMDOBwQuj0S4" // buildJwt() @@ -91,7 +90,8 @@ class JwtServiceTest { // parseJwt() @Test - fun `parseJwt() does things`() { + fun `parseJwt() returns expected user`() { + val jwt = jwtService.buildJwt(user) val parsedUser = jwtService.parseJwt(jwt) assertEquals(userOutputDto, parsedUser)