Added unit test for contextValidate error handling