### Question:
QueueService extends BaseService { public Result verifyQueue(String queue, String queueName) { Result result = new Result(); if (StringUtils.isEmpty(queue)) { putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, "queue"); return result; } if (StringUtils.isEmpty(queueName)) { putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, "queueName"); return result; } if (checkQueueNameExist(queueName)) { logger.error("queue name {} has exist, can't create again.", queueName); putMsg(result, Status.QUEUE_NAME_EXIST, queueName); return result; } if (checkQueueExist(queue)) { logger.error("queue value {} has exist, can't create again.", queue); putMsg(result, Status.QUEUE_VALUE_EXIST, queue); return result; } putMsg(result, Status.SUCCESS); return result; }  Map<String, Object> queryList(User loginUser); Map<String, Object> queryList(User loginUser, String searchVal, Integer pageNo, Integer pageSize); Map<String, Object> createQueue(User loginUser, String queue, String queueName); Map<String, Object> updateQueue(User loginUser, int id, String queue, String queueName); Result verifyQueue(String queue, String queueName);  }### Answer:
@Test public void testVerifyQueue(){ Mockito.when(queueMapper.queryAllQueueList(queueName, null)).thenReturn(getQueueList()); Mockito.when(queueMapper.queryAllQueueList(null, queueName)).thenReturn(getQueueList()); Result result = queueService.verifyQueue(null,queueName); logger.info(result.toString()); Assert.assertEquals(result.getCode().intValue(), Status.REQUEST_PARAMS_NOT_VALID_ERROR.getCode()); result = queueService.verifyQueue(queueName,null); logger.info(result.toString()); Assert.assertEquals(result.getCode().intValue(), Status.REQUEST_PARAMS_NOT_VALID_ERROR.getCode()); result = queueService.verifyQueue(queueName,queueName); logger.info(result.toString()); Assert.assertEquals(result.getCode().intValue(), Status.QUEUE_NAME_EXIST.getCode()); result = queueService.verifyQueue(queueName,"test"); logger.info(result.toString()); Assert.assertEquals(result.getCode().intValue(), Status.QUEUE_VALUE_EXIST.getCode()); result = queueService.verifyQueue("test","test"); logger.info(result.toString()); Assert.assertEquals(result.getCode().intValue(), Status.SUCCESS.getCode()); }