Constently use assertThatExceptionOf... assertions
Closes gh-37964
This commit is contained in:
@@ -25,7 +25,7 @@ import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.build.mavenplugin.PluginXmlParser.Plugin;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
||||
|
||||
/**
|
||||
* Tests for {@link PluginXmlParser}.
|
||||
@@ -50,9 +50,9 @@ class PluginXmlParserTests {
|
||||
|
||||
@Test
|
||||
void parseNonExistingFileThrowException() {
|
||||
assertThatThrownBy(() -> this.parser.parse(new File("src/test/resources/nonexistent.xml")))
|
||||
.isInstanceOf(RuntimeException.class)
|
||||
.hasCauseInstanceOf(FileNotFoundException.class);
|
||||
assertThatExceptionOfType(RuntimeException.class)
|
||||
.isThrownBy(() -> this.parser.parse(new File("src/test/resources/nonexistent.xml")))
|
||||
.withCauseInstanceOf(FileNotFoundException.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user