概要 @Test アノテーションの expected に例外クラスを指定したテストにて、例外が発生したとき・発生しなかったときの挙動を確認する サンプルプログラムで挙動を確認する JUnit 4.12 を使用する @Test アノテーションの expected について @Test アノテーションの expected は、指定した例外が投げられた際にテストを成功とする。 指定した例外が投げられなかった場合はテストが失敗する。 Test (JUnit API) Optionally specify expected, a Throwable, to cause a test method to succeed if and only if an exception of the specified class is thrown by the method. If the Throwable
