Skip to content

Commit fd5d5b5

Browse files
authored
fix the assertJ in football-match-report (exercism#2181)
1 parent 08adf38 commit fd5d5b5

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

exercises/concept/football-match-reports/src/test/java/FootballMatchReportsTest.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import org.junit.Test;
22

33
import static org.assertj.core.api.Assertions.assertThat;
4-
import static org.junit.Assert.assertThrows;
4+
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
55

66
public 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
}

0 commit comments

Comments
 (0)