### Question:
ConsumerServiceImpl extends AbstractBaseService<ConsumerEntity> implements ConsumerService { protected boolean checkStatus(QueueEntity temp, Map<Long, DbNodeEntity> dbNodeMap) { if (!dbNodeMap.containsKey(temp.getDbNodeId())) { return false; } if (dbNodeMap.get(temp.getDbNodeId()).getReadOnly() == 3) { 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 pullData_checkStatusTest() { QueueEntity queueEntity = new QueueEntity(); queueEntity.setDbNodeId(1); queueEntity.setIp("127.0.0.1"); queueEntity.setId(1L); Map<Long, QueueEntity> data = new HashMap<Long, QueueEntity>(); data.put(queueEntity.getId(), queueEntity); Map<Long, DbNodeEntity> dbNodeMap = new HashMap<Long, DbNodeEntity>(); DbNodeEntity dbNodeEntity = new DbNodeEntity(); dbNodeEntity.setId(2); dbNodeMap.put(dbNodeEntity.getId(), dbNodeEntity); setProperty("mq.consumer.isDbStatusLog", "true"); assertEquals(false, consumerServiceImpl.checkStatus(queueEntity, dbNodeMap)); clear("mq.consumer.isDbStatusLog"); dbNodeEntity = new DbNodeEntity(); dbNodeEntity.setReadOnly(3); dbNodeEntity.setId(queueEntity.getDbNodeId()); dbNodeMap.put(dbNodeEntity.getId(), dbNodeEntity); assertEquals(false, consumerServiceImpl.checkStatus(queueEntity, dbNodeMap)); dbNodeEntity.setReadOnly(1); assertEquals(true, consumerServiceImpl.checkStatus(queueEntity, dbNodeMap)); }