File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import org .junit .Test ;
22
33import static org .assertj .core .api .Assertions .assertThat ;
4- import static org .junit . Assert . assertThrows ;
4+ import static org .assertj . core . api . Assertions . assertThatExceptionOfType ;
55
66public class FootballMatchReportsTest {
77
@@ -50,15 +50,13 @@ public void test_right_wing() {
5050
5151 @ Test
5252 public void test_exception () {
53- assertThrows (
54- IllegalArgumentException .class ,
55- () -> FootballMatchReports .onField (13 ));
53+ assertThatExceptionOfType (IllegalArgumentException .class )
54+ .isThrownBy (() -> FootballMatchReports .onField (13 ));
5655 }
5756
5857 @ Test
5958 public void test_exception_negative_number () {
60- assertThrows (
61- IllegalArgumentException .class ,
62- () -> FootballMatchReports .onField (-1 ));
59+ assertThatExceptionOfType (IllegalArgumentException .class )
60+ .isThrownBy (() -> FootballMatchReports .onField (-1 ));
6361 }
6462}
You can’t perform that action at this time.
0 commit comments