### Question:
UserIdentityServiceImpl extends ServiceImpl<UserIdentityMapper, UserIdentityDO> implements UserIdentityService { @Override public boolean changeUsername(Long userId, String username) { UserIdentityDO userIdentity = UserIdentityDO.builder().identifier(username).build(); QueryWrapper<UserIdentityDO> wrapper = new QueryWrapper<>(); wrapper.lambda().eq(UserIdentityDO::getUserId, userId); return this.baseMapper.update(userIdentity, wrapper) > 0; }  @Override UserIdentityDO createIdentity(Long userId, String identityType, String identifier, String credential); @Override UserIdentityDO createIdentity(UserIdentityDO userIdentity); @Override UserIdentityDO createUsernamePasswordIdentity(Long userId, String identifier, String credential); @Override boolean verifyUsernamePassword(Long userId, String username, String password); @Override boolean changePassword(Long userId, String password); @Override boolean changeUsername(Long userId, String username); @Override boolean changeUsernamePassword(Long userId, String username, String password);  }### Answer:
@Test public void changeUsername() { UserIdentityDO userIdentity = setUp1(); userIdentityService.createIdentity(userIdentity); boolean b = userIdentityService.changeUsername(userIdentity.getUserId(), "pedro1"); assertTrue(b); boolean valid = userIdentityService.verifyUsernamePassword(userIdentity.getUserId(), "pedro1", "123456"); assertTrue(valid); }