JeonDaehong commented on code in PR #8255:
URL: https://github.com/apache/gravitino/pull/8255#discussion_r2296863389
##########
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:
I understand the comment. It seems the current test does not cover
multi-header values or parameters, which is the core issue.
Would it be okay if I submit a new PR with the necessary updates for this?
--
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]