chungen0126 commented on code in PR #11870:
URL: https://github.com/apache/ozone/pull/11870#discussion_r4438554233
##########
hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/s3/endpoint/TestObjectHead.java:
##########
@@ -129,14 +137,50 @@ public void testHeadFailByBadName() throws Exception {
assertStatus(HttpStatus.SC_NOT_FOUND, () -> keyEndpoint.head(bucketName,
"badKeyName"));
}
- @Test
- public void testHeadWithNegativePartNumber() throws Exception {
+ @ParameterizedTest
+ @NullSource
+ @ValueSource(strings = "bytes=0-4")
+ public void testHeadWithNegativePartNumber(String range) throws Exception {
keyEndpoint.queryParamsForTest()
.setInt(S3Consts.QueryParams.PART_NUMBER, -1);
+ when(headers.getHeaderString(RANGE_HEADER)).thenReturn(range);
assertErrorResponse(INVALID_ARGUMENT,
() -> keyEndpoint.head(bucketName, "key1"));
}
+ @ParameterizedTest
+ @ValueSource(strings = {"bytes=0-4", "bytes=100-200", "bytes=abc", ""})
Review Comment:
"bytes=0-4" vs "bytes=100-200" exercises the exact same code path. I think
they are redundant.
--
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]