You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Test code should verify twice the call log.error() with identical parameters, but it is blind for the second call to log.error().
Mockito prints identicals calls but behaves different.
Probably the parameter "Object... arguments" leads the jvm to a different method implementation for log.error() and mockito internally differes between them, but there is not interface in mockito to verify the second call different to the first call.
############ Logging method invocation #1 on mock/spy ########
logger.error("Format {}", "param");
invoked: -> at com.eosts.logappender.AlertLoggerTest.verifyBug(AlertLoggerTest.java:65)
has returned: "null"
############ Logging method invocation #2 on mock/spy ########
logger.error("Format {}", "param");
invoked: -> at com.eosts.logappender.AlertLoggerTest.callLogger(AlertLoggerTest.java:71)
has returned: "null"
############ Logging method invocation #3 on mock/spy ########
logger.error("Format {}", "param");
invoked: -> at com.eosts.logappender.AlertLoggerTest.verifyBug(AlertLoggerTest.java:67)
has thrown: class org.mockito.exceptions.verification.TooFewActualInvocations with message
logger.error("Format {}", "param");
Wanted 2 times:
-> at com.eosts.logappender.AlertLoggerTest.verifyBug(AlertLoggerTest.java:67)
But was 1 time:
-> at com.eosts.logappender.AlertLoggerTest.verifyBug(AlertLoggerTest.java:65)
The text was updated successfully, but these errors were encountered:
Test code should verify twice the call log.error() with identical parameters, but it is blind for the second call to log.error().
Mockito prints identicals calls but behaves different.
Probably the parameter "Object... arguments" leads the jvm to a different method implementation for log.error() and mockito internally differes between them, but there is not interface in mockito to verify the second call different to the first call.
Test code:
Mockito states:
The text was updated successfully, but these errors were encountered: