-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix two unit tests failing locally #4140
Fix two unit tests failing locally #4140
Conversation
Fixes JanusGraph#4139 Signed-off-by: Clement de Groc <[email protected]>
Mockito.doReturn(multiQuery).when(tx).multiQuery(); | ||
Mockito.doReturn(multiQuery).when(tx).multiQuery(anyCollection()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💭 thought: When not specifying the multiQuery()
argument type, the mocked method returns null (in my tests). Could it be because that method is overloaded and accepts both a Collection and varargs?
Assertions.assertEquals(10, suppressedExceptions.length); | ||
for(int i=0; i<10; i++){ | ||
Assertions.assertTrue(suppressedExceptions[i] instanceof ExecutionException && | ||
suppressedExceptions[i].getCause() instanceof IllegalArgumentException); | ||
Assertions.assertTrue(suppressedExceptions[i] instanceof IllegalArgumentException); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Based on the code of CompletableFutureUtil#unwrap
and CompletableFutureUtil#unwrapExecutionException
, it would make sense to me that the exceptions returned are not ExecutionException
s but their "unwrapped" counterpart (IllegalStateException
or IllegalArgumentException
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. Sorry I forgot to change that previously. Initially it was returning ExecutionException but after some fixes I changed this behavior and completely forgot about these Unit tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you @cdegroc !
Assertions.assertEquals(10, suppressedExceptions.length); | ||
for(int i=0; i<10; i++){ | ||
Assertions.assertTrue(suppressedExceptions[i] instanceof ExecutionException && | ||
suppressedExceptions[i].getCause() instanceof IllegalArgumentException); | ||
Assertions.assertTrue(suppressedExceptions[i] instanceof IllegalArgumentException); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. Sorry I forgot to change that previously. Initially it was returning ExecutionException but after some fixes I changed this behavior and completely forgot about these Unit tests.
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
Fixes #4139
Thank you for contributing to JanusGraph!
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
For all changes:
master
)?For code changes:
For documentation related changes: