You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "mreutegg (via GitHub)" <gi...@apache.org> on 2023/05/24 07:31:30 UTC
[GitHub] [jackrabbit-oak] mreutegg commented on a diff in pull request #953: OAK-10259: oak-core tests running out of memory
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: dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org