justinmclean commented on code in PR #8255:
URL: https://github.com/apache/gravitino/pull/8255#discussion_r2296861989


##########
core/src/test/java/org/apache/gravitino/storage/relational/service/TestGroupMetaService.java:
##########
@@ -1012,4 +1012,44 @@ private Integer countGroupRoleRels() {
     }
     return count;
   }
+
+  @Test
+  void updateGroupWithoutRoleChange() throws IOException {
+    AuditInfo auditInfo =
+        
AuditInfo.builder().withCreator("creator").withCreateTime(Instant.now()).build();
+    BaseMetalake metalake =
+        createBaseMakeLake(RandomIdGenerator.INSTANCE.nextId(), metalakeName, 
auditInfo);
+    backend.insert(metalake, false);
+
+    GroupMetaService groupMetaService = GroupMetaService.getInstance();
+
+    GroupEntity group1 =
+        createGroupEntity(
+            RandomIdGenerator.INSTANCE.nextId(),
+            AuthorizationUtils.ofGroupNamespace(metalakeName),
+            "group1",
+            auditInfo);
+    groupMetaService.insertGroup(group1, false);
+
+    Function<GroupEntity, GroupEntity> renameUpdater =
+        group ->
+            GroupEntity.builder()
+                .withNamespace(group.namespace())
+                .withId(group.id())
+                .withName("group_renamed")
+                .withRoleNames(group.roleNames())
+                .withRoleIds(group.roleIds())
+                .withAuditInfo(group.auditInfo())
+                .build();
+    groupMetaService.updateGroup(group1.nameIdentifier(), renameUpdater);
+
+    Assertions.assertThrows(
+        NoSuchEntityException.class,
+        () -> groupMetaService.getGroupByIdentifier(group1.nameIdentifier()));
+
+    GroupEntity updated =
+        groupMetaService.getGroupByIdentifier(
+            AuthorizationUtils.ofGroup(metalakeName, "group_renamed"));
+    Assertions.assertEquals("group_renamed", updated.name());
+  }

Review Comment:
   This test does not test multiple header values or parameters at all. 
Instead, it creates one header string at a time. It needs to test multiple 
values, e.g., "application/vnd.gravitino.v1+json, application/json" or 
"application/vnd.gravitino.v1+json; q=0.9," which is the main point of #8053.



-- 
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: commits-unsubscr...@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to