### Question:
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);  }### Answer:
@Test(expectedExceptions = ValidationException.class, expectedExceptionsMessageRegExp = "Unable to POST a null object") public void testPOSTValidationNullObject() { DefaultDataObjectRequest<Agenda> request = createAgendaRequest(null); validator.validatePOST(request); }
@Test(expectedExceptions = ValidationException.class, expectedExceptionsMessageRegExp = ".*The customerId field must be specified.*") public void testInvalidCustomer() { DefaultDataObjectRequest<Agenda> request = createAgendaRequest(""); request.setDataObject(new Agenda()); validator.validatePOST(request); }