### Question:
LogServiceImpl implements LogService { @Override public void addConsumerLog(LogRequest request) { if (request == null) { return; } String logContent = getLog(request); if (request.getType() >= 3) { Map<String, ConsumerGroupEntity> cache = consumerGroupService.getCache(); if (!StringUtils.isEmpty(request.getConsumerGroupName()) && cache.containsKey(request.getConsumerGroupName())) { if (cache.get(request.getConsumerGroupName()).getTraceFlag() == 1) { log.info(logContent); } } } else { log.info(getLog(request)); } addMsgLog(request, logContent); }  @Override void addConsumerLog(LogRequest request); @Override void addBrokerLog(LogDto request); @Override void addOpLog(OpLogRequest request);  }### Answer:
@Test public void addConsumerLogTest() { LogRequest request=new LogRequest(); logServiceImpl.addConsumerLog(null); request.setConsumerGroupName("test"); request.setType(1); logServiceImpl.addConsumerLog(request); request.setType(3); Map<String, ConsumerGroupEntity> map =new HashMap<String, ConsumerGroupEntity>(); ConsumerGroupEntity consumerGroupEntity=new ConsumerGroupEntity(); consumerGroupEntity.setTraceFlag(1); map.put(request.getConsumerGroupName(), consumerGroupEntity); when(consumerGroupService.getCache()).thenReturn(map); logServiceImpl.addConsumerLog(request); }