@Test public void test_should_not_send_email_when_email_address_is_not_present() { repository.send(null, "otpNumber"); verify(kakfaTemplate, never()).send(any(), any()); }
public void send(String email, String otpNumber) { if (isEmpty(email)) { return; } sendEmail(email, otpNumber); }
OtpEmailRepository { public void send(String email, String otpNumber) { if (isEmpty(email)) { return; } sendEmail(email, otpNumber); } }
OtpEmailRepository { public void send(String email, String otpNumber) { if (isEmpty(email)) { return; } sendEmail(email, otpNumber); } @Autowired  OtpEmailRepository(CustomKafkaTemplate<String, EmailMessage> kafkaTemplate,
							  @Value("${email.topic}") String emailTopic); }
OtpEmailRepository { public void send(String email, String otpNumber) { if (isEmpty(email)) { return; } sendEmail(email, otpNumber); } @Autowired  OtpEmailRepository(CustomKafkaTemplate<String, EmailMessage> kafkaTemplate,
							  @Value("${email.topic}") String emailTopic); void send(String email, String otpNumber); }
OtpEmailRepository { public void send(String email, String otpNumber) { if (isEmpty(email)) { return; } sendEmail(email, otpNumber); } @Autowired  OtpEmailRepository(CustomKafkaTemplate<String, EmailMessage> kafkaTemplate,
							  @Value("${email.topic}") String emailTopic); void send(String email, String otpNumber);  }