File tree Expand file tree Collapse file tree 7 files changed +18
-8
lines changed
main/kotlin/com/gotchai/api/presentation/v1/exam
test/kotlin/com/gotchai/api/presentation/v1/exam
domain/src/testFixtures/kotlin/com/gotchai/domain/fixture
infrastructure/oauth/src/main/kotlin/com/gotchai/infrastructure/oauth
storage/rdb/src/main/kotlin/com/gotchai/storage/rdb/exam/adapter/out Expand file tree Collapse file tree 7 files changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ class ExamController(
3131 @AuthenticationPrincipal
3232 userId : Long
3333 ): ExamListResponse =
34- examQueryUseCase.getExamsByUserId(userId)
34+ examQueryUseCase
35+ .getExamsByUserId(userId)
3536 .let { ExamListResponse .from(it) }
3637}
Original file line number Diff line number Diff line change @@ -73,7 +73,8 @@ class ExamControllerTest : ControllerTest() {
7373 }
7474
7575 it(" 상태 코드 200과 ExamListResponse를 반환한다." ) {
76- webClient.get()
76+ webClient
77+ .get()
7778 .uri(" /api/v1/users/me/exam/solved" )
7879 .exchange()
7980 .expectStatus()
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ fun createGetExamResult(
5454 iconImage : String = ICON_IMAGE ,
5555 theme : String = THEME ,
5656 quizIds : List <Long > = listOf(ID ),
57- createdAt : LocalDateTime = CREATED_AT ,
57+ createdAt : LocalDateTime = CREATED_AT
5858): GetExamResult =
5959 GetExamResult (
6060 id = id,
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ package com.gotchai.infrastructure.oauth.client
33import com.fasterxml.jackson.databind.ObjectMapper
44import com.gotchai.domain.auth.exception.InvalidOAuthTokenException
55import com.gotchai.infrastructure.oauth.config.AppleProperties
6- import com.gotchai.infrastructure.oauth.dto.ApplePublicKey
6+ import com.gotchai.infrastructure.oauth.dto.ApplePublicKeyResponse
77import com.gotchai.infrastructure.oauth.dto.AppleUser
88import com.nimbusds.jose.crypto.RSASSAVerifier
99import com.nimbusds.jose.jwk.JWK
@@ -52,17 +52,18 @@ class AppleClient(
5252
5353 private fun isSignatureValid (signedJWT : SignedJWT ): Boolean =
5454 getPublicKeys()
55+ .keys
5556 .map {
5657 val rsaKey = JWK .parse(objectMapper.writeValueAsString(it)) as RSAKey
5758 val publicKey = rsaKey.toRSAPublicKey()
5859
5960 RSASSAVerifier (publicKey)
6061 }.any { signedJWT.verify(it) }
6162
62- private fun getPublicKeys (): List < ApplePublicKey > =
63+ private fun getPublicKeys (): ApplePublicKeyResponse =
6364 restClient
6465 .get()
6566 .uri(" $APPLE_URI /auth/keys" )
6667 .retrieve()
67- .requiredBody<List < ApplePublicKey > >()
68+ .requiredBody<ApplePublicKeyResponse >()
6869}
Original file line number Diff line number Diff line change 1+ package com.gotchai.infrastructure.oauth.dto
2+
3+ data class ApplePublicKeyResponse (
4+ val keys : List <ApplePublicKey >
5+ )
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ class ExamQueryAdapter(
1919
2020 @ReadOnlyTransactional
2121 override fun getExamsByInIn (ids : Collection <Long >): List <Exam > =
22- examJpaRepository.findByIdIn(ids)
22+ examJpaRepository
23+ .findByIdIn(ids)
2324 .map { it.toExam() }
2425}
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ class ExamResultQueryAdapter(
1010 private val examResultJpaRepository : ExamResultJpaRepository
1111) : ExamResultQueryPort {
1212 override fun getExamResultsByUserId (userId : Long ): List <ExamResult > =
13- examResultJpaRepository.findExamResultsByUserId(userId)
13+ examResultJpaRepository
14+ .findExamResultsByUserId(userId)
1415 .map { it.toExamResult() }
1516}
You can’t perform that action at this time.
0 commit comments