adoroszlai commented on code in PR #6489:
URL: https://github.com/apache/ozone/pull/6489#discussion_r1563631722
##########
hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/s3/endpoint/TestPermissionCheck.java:
##########
@@ -42,6 +42,7 @@
import java.util.Map;
import static java.net.HttpURLConnection.HTTP_FORBIDDEN;
+import static org.mockito.ArgumentMatchers.anyMap;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.anyBoolean;
import static org.mockito.Mockito.anyLong;
Review Comment:
nit: import from `Mockito`.
```suggestion
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.anyBoolean;
import static org.mockito.Mockito.anyLong;
import static org.mockito.Mockito.anyMap;
```
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneRpcClientAbstract.java:
##########
@@ -3661,12 +3688,26 @@ private void doMultipartUpload(OzoneBucket bucket,
String keyName, byte val,
latestVersionLocations.getBlocksLatestVersionOnly()
.forEach(omKeyLocationInfo ->
assertNotEquals(-1, omKeyLocationInfo.getPartNumber()));
+
+ Map<String, String> keyMetadata = omKeyInfo.getMetadata();
+ assertNotNull(keyMetadata.get(ETAG));
+ if (customMetadata != null) {
+ for (Map.Entry<String, String> customEntry : customMetadata.entrySet()) {
+ assertTrue(keyMetadata.containsKey(customEntry.getKey()));
+ assertEquals(customEntry.getValue(),
keyMetadata.get(customEntry.getKey()));
+ }
Review Comment:
Use `assertThat` instead of `assertTrue` for better message in case of
failure. It also provides assertions for maps.
```suggestion
assertThat(keyMetadata).containsAllEntriesOf(customMetadata);
```
--
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]