### Question:
ConsumerGroupTopicServiceImpl extends AbstractBaseService<ConsumerGroupTopicEntity> implements CacheUpdateService, ConsumerGroupTopicService, TimerService { @Transactional(rollbackFor = Exception.class) @Override public ConsumerGroupTopicCreateResponse subscribe(ConsumerGroupTopicCreateRequest consumerGroupTopicCreateRequest) { return subscribe(consumerGroupTopicCreateRequest, consumerGroupService.getCache()); }  @Override void start(); @Override void updateCache(); @Override void forceUpdateCache(); @Override Map<Long, Map<String, ConsumerGroupTopicEntity>> getCache(); @Override Map<String, ConsumerGroupTopicEntity> getGroupTopic(); @Override void deleteByConsumerGroupId(long consumerGroupId); @Override void deleteByOriginTopicName(long consumerGroupId, String originTopicName); @Override List<String> getFailTopicNames(long consumerGroupId); @Override ConsumerGroupTopicEntity getCorrespondConsumerGroupTopic(Map<String, Object> parameterMap); @Override void updateEmailByGroupName(String groupName, String alarmEmails); @PreDestroy @Override void stop(); @Override String info(); @Override String getCacheJson(); @Override Map<String, List<ConsumerGroupTopicEntity>> getTopicSubscribeMap(); @Transactional(rollbackFor = Exception.class) @Override ConsumerGroupTopicCreateResponse subscribe(ConsumerGroupTopicCreateRequest consumerGroupTopicCreateRequest); @Override ConsumerGroupTopicCreateResponse subscribe(ConsumerGroupTopicCreateRequest consumerGroupTopicCreateRequest,Map<String, ConsumerGroupEntity> consumerGroupMap); @Override ConsumerGroupTopicEntity createConsumerGroupTopic(
			ConsumerGroupTopicCreateRequest consumerGroupTopicCreateRequest); @Transactional(rollbackFor = Exception.class) @Override ConsumerGroupTopicDeleteResponse deleteConsumerGroupTopic(long consumerGroupTopicId);  }### Answer:
@Test public void subscribeTest() { ConsumerGroupEntity consumerGroupEntity = new ConsumerGroupEntity(); consumerGroupEntity.setMode(2); consumerGroupEntity.setName("test"); consumerGroupEntity.setOriginName("test"); consumerGroupEntity.setId(1L); Map<String, ConsumerGroupEntity> consumerGroupMap = new HashMap<String, ConsumerGroupEntity>(); consumerGroupMap.put(consumerGroupEntity.getName(), consumerGroupEntity); when(consumerGroupService.getCache()).thenReturn(consumerGroupMap); ConsumerGroupTopicCreateRequest consumerGroupTopicCreateRequest = new ConsumerGroupTopicCreateRequest(); consumerGroupTopicCreateRequest.setConsumerGroupId(consumerGroupEntity.getId() + 1); consumerGroupTopicCreateRequest.setConsumerGroupName(consumerGroupEntity.getName()); consumerGroupTopicCreateRequest.setTopicId(1L); consumerGroupTopicCreateRequest.setTopicName("test"); consumerGroupTopicCreateRequest.setTopicType(1); consumerGroupTopicCreateRequest.setDelayProcessTime(1); consumerGroupTopicCreateRequest.setMaxLag(2000); consumerGroupTopicCreateRequest.setPullBatchSize(200); consumerGroupTopicCreateRequest.setRetryCount(2); consumerGroupTopicCreateRequest.setThreadSize(3); consumerGroupTopicCreateRequest.setTimeOut(1); consumerGroupTopicCreateRequest.setDelayPullTime(1); TopicEntity topicEntity = new TopicEntity(); topicEntity.setAppId("123213"); topicEntity.setId(1); topicEntity.setBusinessType("类型"); when(topicService.get(anyLong())).thenReturn(topicEntity); TopicEntity failTopicEntity = new TopicEntity(); failTopicEntity.setAppId("1232112133"); failTopicEntity.setId(12); failTopicEntity.setBusinessType("类型"); when(topicService.createFailTopic(any(TopicEntity.class), any(ConsumerGroupEntity.class))) .thenReturn(failTopicEntity); when(consumerGroupService.get(anyLong())).thenReturn(consumerGroupEntity); consumerGroupTopicServiceImpl.subscribe(consumerGroupTopicCreateRequest); verify(queueOffsetService, times(4)).createQueueOffset(any(ConsumerGroupTopicEntity.class)); }