### Question:
UserServiceImpl extends ServiceImpl<UserMapper, UserDO> implements UserService { @Override public UserDO getUserByUsername(String username) { QueryWrapper<UserDO> wrapper = new QueryWrapper<>(); wrapper.lambda().eq(UserDO::getUsername, username); return this.getOne(wrapper); }  @Transactional @Override UserDO createUser(RegisterDTO dto); @Transactional @Override UserDO updateUserInfo(UpdateInfoDTO dto); @Override UserDO changeUserPassword(ChangePasswordDTO dto); @Override List<GroupDO> getUserGroups(Long userId); @Override List<Map<String, List<Map<String, String>>>> getStructualUserPermissions(Long userId); @Override List<PermissionDO> getUserPermissions(Long userId); @Override UserDO getUserByUsername(String username); @Override boolean checkUserExistByUsername(String username); @Override boolean checkUserExistByEmail(String email); @Override boolean checkUserExistById(Long id); @Override IPage<UserDO> getUserPageByGroupId(Page pager, Long groupId);  }### Answer:
@Test public void findByUsername() { UserDO user = userService.getUserByUsername("pedro"); log.info("user:{}", user); assertEquals(user.getUsername(), "pedro"); }