-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
8 changed files
with
31 additions
and
117 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
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 |
---|---|---|
|
@@ -7,14 +7,13 @@ import org.junit.jupiter.api.assertThrows | |
import org.junit.jupiter.api.extension.ExtendWith | ||
import org.mockito.BDDMockito.given | ||
import org.mockito.BDDMockito.willDoNothing | ||
import org.mockito.kotlin.any | ||
import org.springframework.boot.test.mock.mockito.MockBean | ||
import org.springframework.test.context.junit.jupiter.SpringExtension | ||
import team.comit.simtong.domain.auth.exception.CertifiedEmailException | ||
import team.comit.simtong.domain.auth.exception.ExceededSendAuthCodeRequestException | ||
import team.comit.simtong.domain.auth.model.AuthCode | ||
import team.comit.simtong.domain.auth.model.AuthCodeLimit | ||
import team.comit.simtong.domain.auth.service.ConstructAuthCodeLimitService | ||
import team.comit.simtong.domain.auth.service.ConstructAuthCodeService | ||
import team.comit.simtong.domain.auth.spi.CommandAuthCodeLimitPort | ||
import team.comit.simtong.domain.auth.spi.CommandAuthCodePort | ||
import team.comit.simtong.domain.auth.spi.QueryAuthCodeLimitPort | ||
|
@@ -35,27 +34,12 @@ class SendAuthCodeUseCaseTests { | |
@MockBean | ||
private lateinit var sendEmailPort: SendEmailPort | ||
|
||
@MockBean | ||
private lateinit var constructAuthCodeLimitService: ConstructAuthCodeLimitService | ||
|
||
@MockBean | ||
private lateinit var constructAuthCodeService: ConstructAuthCodeService | ||
|
||
private lateinit var sendAuthCodeUseCase: SendAuthCodeUseCase | ||
|
||
private val email = "[email protected]" | ||
|
||
private val code = "123456" | ||
|
||
private val authCodeLimitStub by lazy { | ||
AuthCodeLimit( | ||
key = email, | ||
expirationTime = AuthCodeLimit.EXPIRED, | ||
attemptCount = 0, | ||
isVerified = false | ||
) | ||
} | ||
|
||
private val verifiedAuthCodeLimitStub by lazy { | ||
AuthCodeLimit( | ||
key = email, | ||
|
@@ -88,8 +72,6 @@ class SendAuthCodeUseCaseTests { | |
commandAuthCodeLimitPort, | ||
commandAuthCodePort, | ||
queryAuthCodeLimitPort, | ||
constructAuthCodeLimitService, | ||
constructAuthCodeService, | ||
sendEmailPort | ||
) | ||
} | ||
|
@@ -100,13 +82,7 @@ class SendAuthCodeUseCaseTests { | |
given(queryAuthCodeLimitPort.queryAuthCodeLimitByEmail(email)) | ||
.willReturn(null) | ||
|
||
given(constructAuthCodeLimitService.construct(email)) | ||
.willReturn(authCodeLimitStub) | ||
|
||
given(constructAuthCodeService.construct(email)) | ||
.willReturn(authCodeStub) | ||
|
||
given(commandAuthCodePort.save(authCodeStub)) | ||
given(commandAuthCodePort.save(any())) | ||
.willReturn(authCodeStub) | ||
|
||
willDoNothing().given(sendEmailPort).sendAuthCode(code, email) | ||
|
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
35 changes: 0 additions & 35 deletions
35
...n/src/main/kotlin/team/comit/simtong/domain/auth/service/ConstructAuthCodeLimitService.kt
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
...domain/src/main/kotlin/team/comit/simtong/domain/auth/service/ConstructAuthCodeService.kt
This file was deleted.
Oops, something went wrong.