private void validateSuccessfulVerification( FrontLineWorkerVerificationRequest request, Errors errors) { if (request.getDesignation() == null) { errors.add("designation field has invalid/blank value"); } if (isBlank(request.getName()) || !Pattern.matches("[a-zA-Z0-9\\s\\.]*", request.getName())) { errors.add("name field has invalid/blank value"); } new WebRequestValidator().validateLocation(request.getLocation(), errors); if (request.getReason() != null) { errors.add("reason field should not be a part of the request"); } validateChangeMSISDNRequest(request.getChangeMsisdnRequest(), errors); }
private void validateInvalidOtherRequest( FrontLineWorkerVerificationRequest request, Errors errors) { if (isBlank(request.getReason())) { errors.add("reason field has blank value"); } if (request.getName() != null) { errors.add("name field should not be a part of the request"); } if (request.getLocation() != null) { errors.add("location field should not be a part of the request"); } if (request.getDesignation() != null) { errors.add("designation field should not be a part of the request"); } }