@Test public void test_should_send_password_reset_sms_request_to_topic() { final String mobileNumber = "mobileNumber"; final String tenantId = "tenantId"; final String otpNumber = "otpNumber"; final OtpRequestType type = OtpRequestType.PASSWORD_RESET; final OtpRequest otpRequest = new OtpRequest(mobileNumber, tenantId, type, "CITIZEN"); final String expectedMessage = "Your OTP for recovering password is otpNumber."; final SMSRequest expectedSmsRequest = new SMSRequest(mobileNumber, expectedMessage); final SendResult<String, SMSRequest> sendResult = new SendResult<>(null, null); when(kafkaTemplate.send(eq(SMS_TOPIC), argThat(new SmsRequestMatcher(expectedSmsRequest)))) .thenReturn(sendResult); otpSMSRepository.send(otpRequest, otpNumber); verify(kafkaTemplate).send(eq(SMS_TOPIC), argThat(new SmsRequestMatcher(expectedSmsRequest))); }
public void send(OtpRequest otpRequest, String otpNumber) { final String message = getMessage(otpNumber, otpRequest); kafkaTemplate.send(smsTopic, new SMSRequest(otpRequest.getMobileNumber(), message)); }
OtpSMSRepository { public void send(OtpRequest otpRequest, String otpNumber) { final String message = getMessage(otpNumber, otpRequest); kafkaTemplate.send(smsTopic, new SMSRequest(otpRequest.getMobileNumber(), message)); } }
OtpSMSRepository { public void send(OtpRequest otpRequest, String otpNumber) { final String message = getMessage(otpNumber, otpRequest); kafkaTemplate.send(smsTopic, new SMSRequest(otpRequest.getMobileNumber(), message)); } @Autowired  OtpSMSRepository(CustomKafkaTemplate<String, SMSRequest> kafkaTemplate,
			@Value("${sms.topic}") String smsTopic); }
OtpSMSRepository { public void send(OtpRequest otpRequest, String otpNumber) { final String message = getMessage(otpNumber, otpRequest); kafkaTemplate.send(smsTopic, new SMSRequest(otpRequest.getMobileNumber(), message)); } @Autowired  OtpSMSRepository(CustomKafkaTemplate<String, SMSRequest> kafkaTemplate,
			@Value("${sms.topic}") String smsTopic); void send(OtpRequest otpRequest, String otpNumber); }
OtpSMSRepository { public void send(OtpRequest otpRequest, String otpNumber) { final String message = getMessage(otpNumber, otpRequest); kafkaTemplate.send(smsTopic, new SMSRequest(otpRequest.getMobileNumber(), message)); } @Autowired  OtpSMSRepository(CustomKafkaTemplate<String, SMSRequest> kafkaTemplate,
			@Value("${sms.topic}") String smsTopic); void send(OtpRequest otpRequest, String otpNumber);  }