### Question:
ConsumerServiceImpl extends AbstractBaseService<ConsumerEntity> implements ConsumerService { protected boolean checkFailTime(String topicName, QueueEntity entity, List<String> logLst) { if (dbFailMap.containsKey(getFailDbUp(entity)) && (System.currentTimeMillis() - dbFailMap.get(getFailDbUp(entity))) < soaConfig.getDbFailWaitTime() * 1000L) { if (logLst == null) { log.info("topicName_{}_queueid_{}_is_fail", topicName, entity.getId()); } return false; } return true; }  @Override @Transactional(rollbackFor = Exception.class) ConsumerRegisterResponse register(ConsumerRegisterRequest request); @Override @Transactional(rollbackFor = Exception.class) ConsumerDeRegisterResponse deRegister(ConsumerDeRegisterRequest deRegisterRequest); @Override void heartbeat(List<Long> ids); @Override List<ConsumerGroupConsumerEntity> getConsumerGroupByConsumerIds(List<Long> consumerIds); @Override List<ConsumerGroupConsumerEntity> getConsumerGroupByConsumerGroupIds(List<Long> consumerGroupIds); @Override //@Transactional(rollbackFor = Exception.class) ConsumerGroupRegisterResponse registerConsumerGroup(ConsumerGroupRegisterRequest request); @Override PublishMessageResponse publish(PublishMessageRequest request); void notifyClient(QueueEntity queueEntity); @Override PullDataResponse pullData(PullDataRequest request); @Override GetMessageCountResponse getMessageCount(GetMessageCountRequest request); @Override List<ConsumerEntity> findByHeartTimeInterval(long heartTimeInterval); @Override boolean deleteByConsumers(List<ConsumerEntity> consumers); @Override ConsumerEntity getConsumerByConsumerGroupId(Long consumerGroupId); @Override long countBy(Map<String, Object> conditionMap); @Override List<ConsumerEntity> getListBy(Map<String, Object> conditionMap); @Override FailMsgPublishAndUpdateResultResponse publishAndUpdateResultFailMsg(
            FailMsgPublishAndUpdateResultRequest request);  }### Answer:
@Test public void checkFailTimeTest() { QueueEntity queueEntity = new QueueEntity(); queueEntity.setDbNodeId(1); queueEntity.setIp("127.0.0.1"); assertEquals(true, consumerServiceImpl.checkFailTime("test", queueEntity, null)); consumerServiceImpl.dbFailMap.put(queueEntity.getIp(), System.currentTimeMillis()); assertEquals(false, consumerServiceImpl.checkFailTime("test", queueEntity, null)); assertEquals(false, consumerServiceImpl.checkFailTime("test", queueEntity, new ArrayList<String>())); consumerServiceImpl.dbFailMap.put(queueEntity.getIp(), System.currentTimeMillis() - soaConfig.getDbFailWaitTime() * 2000L); assertEquals(true, consumerServiceImpl.checkFailTime("test", queueEntity, null)); }