java - How to make a Junit test case fail if there is any exception in the code? -


i wrote junit test unit test code. want junit test case fail when exception in code. tried using assert statement, when exception in code, junit test case passing. please can tell me how can achieve this? thanks.

you can assert global variable "excepted" = null or , initialize equal information string in catch block.


Comments

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -