mreutegg commented on code in PR #953:
URL: https://github.com/apache/jackrabbit-oak/pull/953#discussion_r1203598191
##########
oak-core/src/test/java/org/apache/jackrabbit/oak/security/authentication/user/LoginModuleImplTest.java:
##########
@@ -106,7 +105,6 @@ public class LoginModuleImplTest extends
AbstractSecurityTest {
@Override
public void after() throws Exception {
try {
- clearInvocations(monitor);
Review Comment:
With this line the test failed with:
```
org.mockito.exceptions.misusing.NotAMockException: Argument should be a
mock, but is: class
org.apache.jackrabbit.oak.spi.security.authentication.LoginModuleMonitor$MockitoMock$AIxpL0Xb
at
org.apache.jackrabbit.oak.security.authentication.user.LoginModuleImplTest.after(LoginModuleImplTest.java:110)
```
It seems the sequence how multiple After methods on the same class are
called is determined by method name (lexicographic ordering?). It means the
existing `after()` method is called first and then the newly introduced
`clearMocks()`.
I will revert the change in `LoginModuleImplTest` and move
`Mockito.framework().clearInlineMocks()` to the existing `after()` method. The
changes to `LoginContextProviderImplTest` will still be necessary though.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]