### Question:
EmailServiceImpl implements EmailService { @Override public void sendProduceMail(SendMailRequest request) { sendByProducer(request); addLogMsg(request); }  @Override void sendConsumerMail(SendMailRequest request); @Override void sendProduceMail(SendMailRequest request);  }### Answer:
@Test public void sendProduceMailTest() { SendMailRequest sendMailRequest=new SendMailRequest(); sendMailRequest.setConsumerGroupName("test"); sendMailRequest.setTopicName("test"); sendMailRequest.setType(1); sendMailRequest.setSubject("test"); Map<String, TopicEntity> map = new HashMap<String, TopicEntity>(); map.put(sendMailRequest.getTopicName(), new TopicEntity()); when(topicService.getCache()).thenReturn(map); emailServiceImpl.sendProduceMail(sendMailRequest); }