Gargi-jais11 commented on code in PR #9457:
URL: https://github.com/apache/ozone/pull/9457#discussion_r2596997260


##########
hadoop-ozone/integration-test-s3/src/test/java/org/apache/hadoop/ozone/s3/awssdk/v2/AbstractS3SDKV2Tests.java:
##########
@@ -383,6 +384,108 @@ public void testCopyObject() {
     assertEquals("\"37b51d194a7513e45b56f6524f2d51f2\"", 
copyObjectResponse.copyObjectResult().eTag());
   }
 
+  @Test
+  public void testPutObjectTagging() {
+    final String bucketName = getBucketName();
+    final String keyName = getKeyName();
+    final String content = "test content";
+    s3Client.createBucket(b -> b.bucket(bucketName));
+
+    s3Client.putObject(b -> b
+            .bucket(bucketName)
+            .key(keyName),
+        RequestBody.fromString(content));
+
+    List<Tag> tags = Arrays.asList(
+        Tag.builder().key("env").value("test").build(),
+        Tag.builder().key("project").value("ozone").build()
+    );
+
+    s3Client.putObjectTagging(b -> b
+        .bucket(bucketName)
+        .key(keyName)
+        .tagging(Tagging.builder().tagSet(tags).build()));
+
+    GetObjectTaggingResponse response = s3Client.getObjectTagging(b -> b
+        .bucket(bucketName)
+        .key(keyName));
+
+    assertEquals(tags.size(), response.tagSet().size());
+    Map<String, String> tagMap = response.tagSet().stream()
+        .collect(Collectors.toMap(Tag::key, Tag::value));
+    assertEquals("test", tagMap.get("env"));
+    assertEquals("ozone", tagMap.get("project"));
+  }
+
+  @Test
+  public void testGetObjectTagging() {

Review Comment:
   `testPutObjectTagging()`and `testGetObjectTagging()`, are functionally very 
similar and could be merged into a single test named as 
`testPutAndGetObjectTagging()`.



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