@Test public void test_should_not_throw_exception_for_a_valid_request() { final OtpRequest otpRequest = OtpRequest.builder().tenantId("tenantId").mobileNumber("1234567890") .type(OtpRequestType.LOGIN).build(); otpRequest.validate(); }
public void validate() { if(isTenantIdAbsent() || isMobileNumberAbsent() || isInvalidType() || isMobileNumberNumeric() || isMobileNumberValidLength()) { throw new InvalidOtpRequestException(this); } }
OtpRequest { public void validate() { if(isTenantIdAbsent() || isMobileNumberAbsent() || isInvalidType() || isMobileNumberNumeric() || isMobileNumberValidLength()) { throw new InvalidOtpRequestException(this); } } }
OtpRequest { public void validate() { if(isTenantIdAbsent() || isMobileNumberAbsent() || isInvalidType() || isMobileNumberNumeric() || isMobileNumberValidLength()) { throw new InvalidOtpRequestException(this); } }  }
OtpRequest { public void validate() { if(isTenantIdAbsent() || isMobileNumberAbsent() || isInvalidType() || isMobileNumberNumeric() || isMobileNumberValidLength()) { throw new InvalidOtpRequestException(this); } }  void validate(); boolean isMobileNumberNumeric(); boolean isMobileNumberValidLength(); boolean isRegistrationRequestType(); boolean isLoginRequestType(); boolean isInvalidType(); boolean isTenantIdAbsent(); boolean isMobileNumberAbsent(); }
OtpRequest { public void validate() { if(isTenantIdAbsent() || isMobileNumberAbsent() || isInvalidType() || isMobileNumberNumeric() || isMobileNumberValidLength()) { throw new InvalidOtpRequestException(this); } }  void validate(); boolean isMobileNumberNumeric(); boolean isMobileNumberValidLength(); boolean isRegistrationRequestType(); boolean isLoginRequestType(); boolean isInvalidType(); boolean isTenantIdAbsent(); boolean isMobileNumberAbsent();  }