Skip to content

Commit

Permalink
using assertThatRuntimeException
Browse files Browse the repository at this point in the history
  • Loading branch information
pfichtner committed Oct 28, 2023
1 parent bc276e1 commit 48243a7
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import static java.util.stream.Collectors.joining;
import static org.approvaltests.Approvals.verify;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatRuntimeException;
import static org.junit.jupiter.api.Assertions.assertAll;
import static org.junit.jupiter.api.Assertions.assertThrows;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -95,10 +95,10 @@ void nested() throws Exception {
}

@Test
void throwsExceptionIfFileCannotBeRead() throws Exception {
void throwsExceptionIfFileCannotBeRead() {
String zip = "XXXXsomeNonExistentFileXXX.jar";
RuntimeException rte = assertThrows(RuntimeException.class, () -> new Log4ShellHunter().check(new File(zip)));
assertThat(rte).hasMessageContainingAll(zip, "not readable");
assertThatRuntimeException().isThrownBy(() -> new Log4ShellHunter().check(new File(zip)))
.withMessageContainingAll(zip, "not readable");
}

@Test
Expand Down

0 comments on commit 48243a7

Please sign in to comment.