-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5caf327
commit 2234664
Showing
6 changed files
with
38 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
src/main/kotlin/site/qbox/qboxserver/domain/member/email/dto/CertifyKeyReq.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package site.qbox.qboxserver.domain.member.email.dto | ||
|
||
data class CertifyKeyReq(val key: String) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired | |
import org.springframework.boot.test.mock.mockito.MockBean | ||
import org.springframework.context.ApplicationEventPublisher | ||
import site.qbox.qboxserver.config.IntegrationTest | ||
import site.qbox.qboxserver.domain.member.email.dto.CertifyKeyReq | ||
import site.qbox.qboxserver.domain.member.email.dto.RegisterEmailReq | ||
import site.qbox.qboxserver.domain.member.email.exception.EmailNotAuthenticatedException | ||
import site.qbox.qboxserver.domain.member.email.infra.AuthenticatedEmailRepo | ||
|
@@ -41,10 +42,11 @@ class EmailAuthenticationSvcTest : IntegrationTest() { | |
|
||
describe("신규 등록이 되어 있을 때 ") { | ||
val email = "[email protected]" | ||
var key = "" | ||
lateinit var key : CertifyKeyReq | ||
beforeEach { | ||
emailAuthenticationSvc.register(RegisterEmailReq(email)) | ||
key = emailAuthKeyRepo.findAll().toList()[0].key | ||
val keyStr = emailAuthKeyRepo.findAll().toList()[0].key | ||
key = CertifyKeyReq(keyStr) | ||
} | ||
context("key 인증 수행을") { | ||
it("성공 시 인증 성공 목록에 추가한다.") { | ||
|
@@ -54,7 +56,7 @@ class EmailAuthenticationSvcTest : IntegrationTest() { | |
|
||
it("수행 시 인증 실패 시 예외를 반환한다.") { | ||
shouldThrow<EmailNotAuthenticatedException> { | ||
emailAuthenticationSvc.authenticate("whatthekey") | ||
emailAuthenticationSvc.authenticate(CertifyKeyReq("asdf")) | ||
} | ||
} | ||
} | ||
|