@Test(expectedExceptions = UnexpectedTypeException.class,
expectedExceptionsMessageRegExp = "HV000030.*")
public void testUnexpectedTypeException() {
ConstraintDescriptorImpl<?> constraintDescriptor = getConstraintDescriptorForProperty( "s2" );
ValueContext valueContext = ValueContext.getLocalExecutionContext(
new Foo(), null, PathImpl.createPathFromString( "s2" )
);
valueContext.setDeclaredTypeOfValidatedElement( Object.class );
constraintValidatorManager.getInitializedValidator(
valueContext,
constraintDescriptor,
constraintValidatorFactory