File tree Expand file tree Collapse file tree
src/test/java/net/jrodolfo/java_evolution/java14 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package net .jrodolfo .java_evolution .java14 ;
22
3- import static org .assertj .core .api .Assertions .assertThatThrownBy ;
3+ import static org .assertj .core .api .Assertions .assertThat ;
4+ import static org .assertj .core .api .Assertions .catchThrowable ;
45import static org .junit .jupiter .api .Assumptions .assumeTrue ;
56
67import org .junit .jupiter .api .Test ;
@@ -11,14 +12,12 @@ class HelpfulNullPointerExceptionExamplesTest {
1112
1213 @ Test
1314 void nullPointerExceptionMessageIdentifiesTheNullPartOfTheChain () {
14- Throwable failure = org . assertj . core . api . Assertions . catchThrowable (examples ::triggerHelpfulNullPointerException );
15+ Throwable failure = catchThrowable (examples ::triggerHelpfulNullPointerException );
1516
1617 // Helpful NPE details can be disabled with -XX:-ShowCodeDetailsInExceptionMessages.
1718 assumeTrue (failure .getMessage () != null , "helpful NullPointerException details are disabled in this JVM" );
1819
19- assertThatThrownBy (() -> {
20- throw failure ;
21- })
20+ assertThat (failure )
2221 .as ("Java 14 helpful NullPointerException messages should identify the null expression" )
2322 .isInstanceOf (NullPointerException .class )
2423 .hasMessageContaining ("address()" );
You can’t perform that action at this time.
0 commit comments