2017-12-23から1日間の記事一覧
調べた範囲だと、JUnit5だと以下のように書くのが一番良さそうだった。 Exception exception = assertThrows(NumberFormatException.class, () -> { Integer.parseInt("1a"); }); throwされた例外の中もassertできるし、try catchを書かなくて良いし、これい…
調べた範囲だと、JUnit5だと以下のように書くのが一番良さそうだった。 Exception exception = assertThrows(NumberFormatException.class, () -> { Integer.parseInt("1a"); }); throwされた例外の中もassertできるし、try catchを書かなくて良いし、これい…