add beforeValidate test case