I have moved assert statement into try catch block