Integration test for validate() method