How do I assert my exception message with JUnit Test annotation?

前端 未结 12 2031
广开言路
广开言路 2020-12-12 08:53

I have written a few JUnit tests with @Test annotation. If my test method throws a checked exception and if I want to assert the message along with the exceptio

12条回答
  •  误落风尘
    2020-12-12 09:09

    If using @Rule, the exception set is applied to all the test methods in the Test class.

提交回复
热议问题