[feat #20] : 공무원 이메일 인증 API #37
GitHub Actions / Test Results
failed
Aug 8, 2024 in 0s
1 fail, 14 skipped, 14 pass in 4s
Annotations
Check warning on line 0 in com.dnd.gongmuin.mail.service.MailServiceTest
github-actions / Test Results
만료된 인증번호를 검증할 수 없다. (com.dnd.gongmuin.mail.service.MailServiceTest) failed
build/test-results/test/TEST-com.dnd.gongmuin.mail.service.MailServiceTest.xml [took 0s]
Raw output
org.opentest4j.AssertionFailedError: Unexpected exception type thrown, expected: <com.dnd.gongmuin.common.exception.runtime.NotFoundException> but was: <org.mockito.exceptions.misusing.PotentialStubbingProblem>
at app//org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at app//org.junit.jupiter.api.AssertThrowsExactly.assertThrowsExactly(AssertThrowsExactly.java:67)
at app//org.junit.jupiter.api.AssertThrowsExactly.assertThrowsExactly(AssertThrowsExactly.java:35)
at app//org.junit.jupiter.api.Assertions.assertThrowsExactly(Assertions.java:3060)
at app//com.dnd.gongmuin.mail.service.MailServiceTest.verifyAuthCodeWithExpired(MailServiceTest.java:104)
at [email protected]/java.lang.reflect.Method.invoke(Method.java:569)
at [email protected]/java.util.ArrayList.forEach(ArrayList.java:1511)
at [email protected]/java.util.ArrayList.forEach(ArrayList.java:1511)
Caused by: org.mockito.exceptions.misusing.PotentialStubbingProblem:
Strict stubbing argument mismatch. Please check:
- this invocation of 'validateData' method:
redisUtil.validateData(
"AuthCode [email protected]",
"123456"
);
-> at com.dnd.gongmuin.mail.service.MailService.verifyMailAuthCode(MailService.java:53)
- has following stubbing(s) with different arguments:
1. redisUtil.validateData(
"[공무인] 공무원 인증 메일입니다[email protected]",
"123456"
);
-> at com.dnd.gongmuin.mail.service.MailServiceTest.verifyAuthCodeWithExpired(MailServiceTest.java:101)
Typically, stubbing argument mismatch indicates user mistake when writing tests.
Mockito fails early so that you can debug potential problem easily.
However, there are legit scenarios when this exception generates false negative signal:
- stubbing the same method multiple times using 'given().will()' or 'when().then()' API
Please use 'will().given()' or 'doReturn().when()' API for stubbing.
- stubbed method is intentionally invoked with different arguments by code under test
Please use default or 'silent' JUnit Rule (equivalent of Strictness.LENIENT).
For more information see javadoc for PotentialStubbingProblem class.
at app//com.dnd.gongmuin.redis.util.RedisUtil.validateData(RedisUtil.java:73)
at app//com.dnd.gongmuin.mail.service.MailService.verifyMailAuthCode(MailService.java:53)
at app//com.dnd.gongmuin.mail.service.MailServiceTest.lambda$verifyAuthCodeWithExpired$0(MailServiceTest.java:104)
at app//org.junit.jupiter.api.AssertThrowsExactly.assertThrowsExactly(AssertThrowsExactly.java:53)
... 6 more
Loading