Add test case for #688
Fix test purpose
Use method `setExpectedException` instead annotation