rdblue commented on code in PR #6029:
URL: https://github.com/apache/iceberg/pull/6029#discussion_r1001908724


##########
dell/src/test/java/org/apache/iceberg/dell/mock/ecs/TestExceptionCode.java:
##########
@@ -66,12 +67,17 @@ public void testExceptionCode() {
   }
 
   public void assertS3Exception(String message, int httpCode, String 
errorCode, Runnable task) {
-    try {
-      task.run();
-      Assert.fail("Expect s3 exception for " + message);
-    } catch (S3Exception e) {
-      Assert.assertEquals(message + ", http code", httpCode, e.getHttpCode());
-      Assert.assertEquals(message + ", error code", errorCode, 
e.getErrorCode());
-    }
+    Assertions.assertThatThrownBy(task::run)

Review Comment:
   This seems more complicated than the original try/catch. Not sure it's worth 
it.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to