JeonDaehong commented on code in PR #8255: URL: https://github.com/apache/gravitino/pull/8255#discussion_r2296868671
########## 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: > Sorry, I'm not having a good day today I need more coffee. That was intended for another issue. Haha, thank you for your hard work~ I’m not sure what time it is there, but if it’s evening, I hope you get some good rest. If it’s daytime, enjoy a nice cup of coffee! Wishing you a great day! -- 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