Xushaohong commented on code in PR #5160:
URL: https://github.com/apache/ozone/pull/5160#discussion_r1286987958
##########
hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/s3/endpoint/TestEndpointBase.java:
##########
@@ -95,12 +95,11 @@ public void testCustomMetadataHeadersSizeOverbig() {
public void init() { }
};
- Exception exception = Assertions.assertThrows(
- IllegalArgumentException.class,
- () -> endpointBase.getCustomMetadataFromHeaders(s3requestHeaders));
- Assert.assertEquals(
- "Illegal user defined metadata. Combined size cannot exceed 2KB.",
- exception.getMessage());
+ try {
+ endpointBase.getCustomMetadataFromHeaders(s3requestHeaders);
+ } catch (OS3Exception ex) {
+ Assert.assertTrue(ex.getCode().contains("MetadataTooLarge"));
+ }
Review Comment:
Here is a logic problem. If no exception is thrown, the UT will finish as
normal but expected false.
--
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]