### Question:
AlertGroupService extends BaseService { public boolean existGroupName(String groupName) { List<AlertGroup> alertGroup = alertGroupMapper.queryByGroupName(groupName); return CollectionUtils.isNotEmpty(alertGroup); }  HashMap<String, Object> queryAlertgroup(); Map<String, Object> listPaging(User loginUser, String searchVal, Integer pageNo, Integer pageSize); Map<String, Object> createAlertgroup(User loginUser, String groupName, AlertType groupType, String desc); Map<String, Object> updateAlertgroup(User loginUser, int id, String groupName, AlertType groupType, String desc); @Transactional(rollbackFor = RuntimeException.class) Map<String, Object> delAlertgroupById(User loginUser, int id); Map<String, Object> grantUser(User loginUser, int alertgroupId, String userIds); boolean existGroupName(String groupName);  }### Answer:
@Test public void testVerifyGroupName() { boolean result = alertGroupService.existGroupName(groupName); Assert.assertFalse(result); Mockito.when(alertGroupMapper.queryByGroupName(groupName)).thenReturn(getList()); result = alertGroupService.existGroupName(groupName); Assert.assertTrue(result); }