@Test
public void testRejection() throws Exception {

	CustomValidationConfiguration validationSpec = new CustomValidationConfiguration();
	validationSpec.setStopSeverity(Severity.Failure);
	validationSpec.setRejectSeverity(Severity.Warning);
	
	MessageValidatorConfiguration validator = new MessageValidatorConfiguration();
	validator.setId("infoValidator");
	validator.setFactory(ValidatorMock.Factory.class.getName());
	validator.addSetting(ValidatorMock.SEVERITY, Severity.Info);        
	validationSpec.addValidator(validator);
	validator = new MessageValidatorConfiguration();
	validator.setId("warningValidator");
	validator.setFactory(ValidatorMock.Factory.class.getName());
	validator.addSetting(ValidatorMock.SEVERITY, Severity.Warning);        
	validationSpec.addValidator(validator);
	
	ValidationResult result = new DefaultValidationExecutor().validate(new UserMessage(), validationSpec);
	
	assertTrue(result.executedAllValidators());
	assertTrue(result.shouldRejectMessage());
	assertFalse(Utils.isNullOrEmpty(result.getValidationErrors()));
	assertNotNull(result.getValidationErrors().get("infoValidator"));
	assertNotNull(result.getValidationErrors().get("warningValidator"));    	
}