Refactor test, replace matcher with try catch