@Test public void test_should_invoke_otp_service_to_validate_otp() { final ServiceRequestType serviceRequestType = mock(ServiceRequestType.class); when(serviceRequestType.isComplaintType()).thenReturn(false); final AuthenticatedUser user = mock(AuthenticatedUser.class); when(user.isAnonymousUser()).thenReturn(false); final ServiceRequest serviceRequest = createServiceRequest(serviceRequestType, user); validator.validate(serviceRequest); verify(otpService).validateOtp(serviceRequest); }
@Override public void validate(ServiceRequest serviceRequest) { otpService.validateOtp(serviceRequest); }
AnonymousComplaintOtpValidator implements ServiceRequestValidator { @Override public void validate(ServiceRequest serviceRequest) { otpService.validateOtp(serviceRequest); } }
AnonymousComplaintOtpValidator implements ServiceRequestValidator { @Override public void validate(ServiceRequest serviceRequest) { otpService.validateOtp(serviceRequest); } AnonymousComplaintOtpValidator(OtpService otpService); }
AnonymousComplaintOtpValidator implements ServiceRequestValidator { @Override public void validate(ServiceRequest serviceRequest) { otpService.validateOtp(serviceRequest); } AnonymousComplaintOtpValidator(OtpService otpService); @Override boolean canValidate(ServiceRequest serviceRequest); @Override void validate(ServiceRequest serviceRequest); }
AnonymousComplaintOtpValidator implements ServiceRequestValidator { @Override public void validate(ServiceRequest serviceRequest) { otpService.validateOtp(serviceRequest); } AnonymousComplaintOtpValidator(OtpService otpService); @Override boolean canValidate(ServiceRequest serviceRequest); @Override void validate(ServiceRequest serviceRequest);  }