@Test(expectedExceptions = ValidationException.class, expectedExceptionsMessageRegExp = "Unable to POST a null object") public void testPOSTValidationNullObject() { DefaultDataObjectRequest<Agenda> request = createAgendaRequest(null); validator.validatePOST(request); }
@Override public void validatePOST(R request) { super.validatePOST(request); validateObjectRequest(request, "POST"); T object = request.getDataObject(); if(object.getCustomerId() == null || object.getCustomerId().trim().length() == 0) throw new ValidationException(CUSTOMER_ID_NOT_SPECIFIED); }
DataObjectValidator extends DefaultRequestValidator<R> { @Override public void validatePOST(R request) { super.validatePOST(request); validateObjectRequest(request, "POST"); T object = request.getDataObject(); if(object.getCustomerId() == null || object.getCustomerId().trim().length() == 0) throw new ValidationException(CUSTOMER_ID_NOT_SPECIFIED); } }
DataObjectValidator extends DefaultRequestValidator<R> { @Override public void validatePOST(R request) { super.validatePOST(request); validateObjectRequest(request, "POST"); T object = request.getDataObject(); if(object.getCustomerId() == null || object.getCustomerId().trim().length() == 0) throw new ValidationException(CUSTOMER_ID_NOT_SPECIFIED); }  }
DataObjectValidator extends DefaultRequestValidator<R> { @Override public void validatePOST(R request) { super.validatePOST(request); validateObjectRequest(request, "POST"); T object = request.getDataObject(); if(object.getCustomerId() == null || object.getCustomerId().trim().length() == 0) throw new ValidationException(CUSTOMER_ID_NOT_SPECIFIED); }  @Override void validatePOST(R request); @Override void validatePUT(R request); }
DataObjectValidator extends DefaultRequestValidator<R> { @Override public void validatePOST(R request) { super.validatePOST(request); validateObjectRequest(request, "POST"); T object = request.getDataObject(); if(object.getCustomerId() == null || object.getCustomerId().trim().length() == 0) throw new ValidationException(CUSTOMER_ID_NOT_SPECIFIED); }  @Override void validatePOST(R request); @Override void validatePUT(R request);  }