### Question:
ConsumerGroupServiceImpl extends AbstractBaseService<ConsumerGroupEntity> implements CacheUpdateService, ConsumerGroupService, TimerService { @Override public BaseUiResponse<Void> deleteTopicNameFromConsumerGroup(ConsumerGroupTopicEntity consumerGroupTopicEntity) { ConsumerGroupEntity consumerGroupEntity = get(consumerGroupTopicEntity.getConsumerGroupId()); String oldTopicNames = consumerGroupEntity.getTopicNames(); String[] names = oldTopicNames.split(","); String finalTopicNames = ""; for (String name : names) { if (!name.equals(consumerGroupTopicEntity.getOriginTopicName())) { finalTopicNames += name; finalTopicNames += ","; } } if (StringUtils.isNotEmpty(finalTopicNames)) { finalTopicNames = finalTopicNames.substring(0, finalTopicNames.length() - 1); } consumerGroupEntity.setTopicNames(finalTopicNames); update(consumerGroupEntity); uiAuditLogService.recordAudit(ConsumerGroupEntity.TABLE_NAME, consumerGroupEntity.getId(), "取消订阅，修改consumerGroup的topic字段，从" + oldTopicNames + "变为：" + finalTopicNames); return new BaseUiResponse<Void>(); }  @Override void start(); @Override void updateCache(); @Override void forceUpdateCache(); @Override List<ConsumerGroupEntity> getLastMetaConsumerGroup(long minMessageId, long maxMessageId); @Override List<ConsumerGroupEntity> getLastRbConsumerGroup(long minMessageId, long maxMessageId); @Override // @Transactional(rollbackFor = Exception.class) void rb(List<QueueOffsetEntity> queueOffsetEntities); @Override void notifyRb(long id); @Override void notifyRb(List<Long> ids); @Override void notifyMeta(long id); @Override void notifyMeta(List<Long> ids); @Override Map<String, ConsumerGroupEntity> getByNames(List<String> names); @Override Map<String, ConsumerGroupEntity> getCache(); @Override Map<Long, ConsumerGroupEntity> getIdCache(); @Override List<String> getSubEnvList(); @Override void notifyOffset(long id); @Override List<ConsumerGroupTopicEntity> getGroupTopic(); @Override ConsumerGroupTopicEntity getTopic(String consumerGroupName, String topicName); @PreDestroy @Override void stop(); @Override List<ConsumerGroupEntity> getByOwnerNames(Map<String, Object> parameterMap); @Override long countByOwnerNames(Map<String, Object> parameterMap); @Override String info(); @Override void notifyRbByNames(List<String> consumerGroupNames); @Override String getCacheJson(); @Override ConsumerGroupCreateResponse createConsumerGroup(ConsumerGroupCreateRequest consumerGroupCreateRequest); @Override ConsumerGroupEditResponse editConsumerGroup(ConsumerGroupEntity consumerGroupEntity); @Override ConsumerGroupDeleteResponse deleteConsumerGroup(long consumerGroupId, boolean checkOnline); @Override BaseUiResponse<Void> addTopicNameToConsumerGroup(ConsumerGroupTopicEntity consumerGroupTopicEntity); @Override BaseUiResponse<Void> deleteTopicNameFromConsumerGroup(ConsumerGroupTopicEntity consumerGroupTopicEntity); @Override @Transactional(rollbackFor = Exception.class, propagation= Propagation.NESTED) void copyAndNewConsumerGroup(ConsumerGroupEntity consumerGroupEntityOld,
			ConsumerGroupEntity consumerGroupEntityNew); @Override Map<String, ConsumerGroupEntity> getData();  }### Answer:
@Test public void deleteTopicNameFromConsumerGroupTest() { ConsumerGroupEntity consumerGroupEntity=new ConsumerGroupEntity(); consumerGroupEntity.setTopicNames("test,test2"); when(consumerGroupRepository.getById(anyLong())).thenReturn(consumerGroupEntity); ConsumerGroupTopicEntity consumerGroupTopicEntity=buildConsumerGroupTopic(); consumerGroupServiceImpl.deleteTopicNameFromConsumerGroup(consumerGroupTopicEntity); verify(consumerGroupRepository).update(any(ConsumerGroupEntity.class)); assertEquals("test2", consumerGroupEntity.getTopicNames()); }