@@ -17,7 +17,7 @@ import org.junit.jupiter.api.DisplayName
17
17
import org.junit.jupiter.api.Test
18
18
import org.springframework.data.repository.findByIdOrNull
19
19
20
- class AuthCodeCommandMockTest () {
20
+ class AuthCodeCommandServiceMockTest () {
21
21
@MockK
22
22
private lateinit var authCodeRepository: AuthCodeRepository
23
23
@@ -28,7 +28,7 @@ class AuthCodeCommandMockTest() {
28
28
private lateinit var userRepository: DefaultUserRepository
29
29
30
30
@InjectMockKs
31
- private lateinit var authCodeCommand : AuthCodeCommand
31
+ private lateinit var authCodeCommandService : AuthCodeCommandService
32
32
33
33
@BeforeEach
34
34
internal fun setUp () {
@@ -40,7 +40,7 @@ class AuthCodeCommandMockTest() {
40
40
41
41
@Test
42
42
fun create () {
43
- val authCode = authCodeCommand .create(" id" )
43
+ val authCode = authCodeCommandService .create(" id" )
44
44
45
45
verify { authCodeRepository.save(eq(authCode)) }
46
46
verify { mailService.sendSignUpAuthCodeMail(any(), any()) }
@@ -51,7 +51,7 @@ class AuthCodeCommandMockTest() {
51
51
fun verify_null () {
52
52
every { authCodeRepository.findByUserIdAndPurpose(ofType(String ::class ), ofType(Purpose ::class )) } returns null
53
53
54
- authCodeCommand .verify(" userId" , Purpose .SIGN_UP , " 123" ) isEqualTo false
54
+ authCodeCommandService .verify(" userId" , Purpose .SIGN_UP , " 123" ) isEqualTo false
55
55
}
56
56
57
57
@DisplayName(" 정상 케이스인 경우, 인증에 성공해야한다." )
@@ -60,7 +60,7 @@ class AuthCodeCommandMockTest() {
60
60
val authCode = AuthCode .createSignUp(" userId" )
61
61
every { authCodeRepository.findByUserIdAndPurpose(ofType(String ::class ), ofType(Purpose ::class )) } returns authCode
62
62
63
- authCodeCommand .verify(" userId" , Purpose .SIGN_UP , authCode.code) isEqualTo true
63
+ authCodeCommandService .verify(" userId" , Purpose .SIGN_UP , authCode.code) isEqualTo true
64
64
}
65
65
66
66
@DisplayName(" 인증 코드가 다른 경우, 인증에 실패해야한다." )
@@ -69,6 +69,6 @@ class AuthCodeCommandMockTest() {
69
69
val authCode = AuthCode .createSignUp(" userId" )
70
70
every { authCodeRepository.findByUserIdAndPurpose(ofType(String ::class ), ofType(Purpose ::class )) } returns authCode
71
71
72
- authCodeCommand .verify(" userId" , Purpose .SIGN_UP , " different" ) isEqualTo false
72
+ authCodeCommandService .verify(" userId" , Purpose .SIGN_UP , " different" ) isEqualTo false
73
73
}
74
74
}
0 commit comments