@Test public void test_should_send_email() throws Exception { EmailNotificationListener emailNotificationListener = new EmailNotificationListener(emailService); EmailRequest emailRequest = EmailRequest.builder() .isHTML(true) .email("email") .subject("subject") .body("body") .build(); emailNotificationListener.listen(emailRequest); final Email expectedEmail = Email.builder() .subject("subject") .body("body") .toAddress("email") .html(true) .build(); verify(emailService).sendEmail(expectedEmail); }
@KafkaListener(topics = "${kafka.topics.notification.mail.name}") public void listen(EmailRequest emailRequest) { emailService.sendEmail(emailRequest.toDomain()); }
EmailNotificationListener { @KafkaListener(topics = "${kafka.topics.notification.mail.name}") public void listen(EmailRequest emailRequest) { emailService.sendEmail(emailRequest.toDomain()); } }
EmailNotificationListener { @KafkaListener(topics = "${kafka.topics.notification.mail.name}") public void listen(EmailRequest emailRequest) { emailService.sendEmail(emailRequest.toDomain()); } EmailNotificationListener(EmailService emailService); }
EmailNotificationListener { @KafkaListener(topics = "${kafka.topics.notification.mail.name}") public void listen(EmailRequest emailRequest) { emailService.sendEmail(emailRequest.toDomain()); } EmailNotificationListener(EmailService emailService); @KafkaListener(topics = "${kafka.topics.notification.mail.name}") void listen(EmailRequest emailRequest); }
EmailNotificationListener { @KafkaListener(topics = "${kafka.topics.notification.mail.name}") public void listen(EmailRequest emailRequest) { emailService.sendEmail(emailRequest.toDomain()); } EmailNotificationListener(EmailService emailService); @KafkaListener(topics = "${kafka.topics.notification.mail.name}") void listen(EmailRequest emailRequest);  }