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
Fix arg-matching in ExceptionMapperTest.testFullExceptionIsLogged() (#2531)
The above test asserts the the log record passed to `org.jboss.logmanager.Logger#logRaw(org.jboss.logmanager.ExtLogRecord)`. For the sake of this test, both the `IcebergJsonProcessingExceptionMapper` and `IcebergExceptionMapper` have a visible-for-testing function `getLogger()` to provide a mocked logger. `getLogger()` however is used for "all the logging", which makes the behavior `verify(JBOSS_LOGGER).logRaw(argThat(...))` "interesting" - the test fails with #2461 although no related dependencies have changed in that PR.
But eventually the test failure's caused by using `getLogger()` for all logging, which may provide the _wrong_ log record and cause the test to fail.
This change renames the `getLogger()` functions to make their special meaning clear, and adds some clarifying comments in the code.
Also adding some more test cases for the various exception mapper code paths.
Co-authored-by: Alexandre Dutra <[email protected]>
Copy file name to clipboardExpand all lines: runtime/service/src/main/java/org/apache/polaris/service/exception/IcebergJsonProcessingExceptionMapper.java
+8-4Lines changed: 8 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,7 @@ public Response toResponse(JsonProcessingException exception) {
0 commit comments