1818
1919import java .util .function .Supplier ;
2020
21+ import org .assertj .core .api .Assertions ;
2122import org .junit .jupiter .api .Test ;
2223
2324import static org .assertj .core .api .Assertions .assertThat ;
2425import static org .assertj .core .api .Assertions .assertThatIllegalArgumentException ;
25- import static org .assertj .core .api .Assertions .fail ;
2626
2727/**
2828 * Tests for {@link PropertyMapper}.
@@ -57,7 +57,7 @@ void fromValueAsIntShouldAdaptValue() {
5757
5858 @ Test
5959 void fromValueAlwaysApplyingWhenNonNullShouldAlwaysApplyNonNullToSource () {
60- this .map .alwaysApplyingWhenNonNull ().from ((String ) null ).toCall (() -> fail () );
60+ this .map .alwaysApplyingWhenNonNull ().from ((String ) null ).toCall (Assertions :: fail );
6161 }
6262
6363 @ Test
@@ -101,14 +101,14 @@ void asShouldAdaptSupplier() {
101101
102102 @ Test
103103 void whenNonNullWhenSuppliedNullShouldNotMap () {
104- this .map .from (() -> null ).whenNonNull ().as (String ::valueOf ).toCall (() -> fail () );
104+ this .map .from (() -> null ).whenNonNull ().as (String ::valueOf ).toCall (Assertions :: fail );
105105 }
106106
107107 @ Test
108108 void whenNonNullWhenSuppliedThrowsNullPointerExceptionShouldNotMap () {
109109 this .map .from (() -> {
110110 throw new NullPointerException ();
111- }).whenNonNull ().as (String ::valueOf ).toCall (() -> fail () );
111+ }).whenNonNull ().as (String ::valueOf ).toCall (Assertions :: fail );
112112 }
113113
114114 @ Test
@@ -119,7 +119,7 @@ void whenTrueWhenValueIsTrueShouldMap() {
119119
120120 @ Test
121121 void whenTrueWhenValueIsFalseShouldNotMap () {
122- this .map .from (false ).whenTrue ().toCall (() -> fail () );
122+ this .map .from (false ).whenTrue ().toCall (Assertions :: fail );
123123 }
124124
125125 @ Test
@@ -130,17 +130,17 @@ void whenFalseWhenValueIsFalseShouldMap() {
130130
131131 @ Test
132132 void whenFalseWhenValueIsTrueShouldNotMap () {
133- this .map .from (true ).whenFalse ().toCall (() -> fail () );
133+ this .map .from (true ).whenFalse ().toCall (Assertions :: fail );
134134 }
135135
136136 @ Test
137137 void whenHasTextWhenValueIsNullShouldNotMap () {
138- this .map .from (() -> null ).whenHasText ().toCall (() -> fail () );
138+ this .map .from (() -> null ).whenHasText ().toCall (Assertions :: fail );
139139 }
140140
141141 @ Test
142142 void whenHasTextWhenValueIsEmptyShouldNotMap () {
143- this .map .from ("" ).whenHasText ().toCall (() -> fail () );
143+ this .map .from ("" ).whenHasText ().toCall (Assertions :: fail );
144144 }
145145
146146 @ Test
@@ -157,7 +157,7 @@ void whenEqualToWhenValueIsEqualShouldMatch() {
157157
158158 @ Test
159159 void whenEqualToWhenValueIsNotEqualShouldNotMatch () {
160- this .map .from ("123" ).whenEqualTo ("321" ).toCall (() -> fail () );
160+ this .map .from ("123" ).whenEqualTo ("321" ).toCall (Assertions :: fail );
161161 }
162162
163163 @ Test
@@ -169,7 +169,7 @@ void whenInstanceOfWhenValueIsTargetTypeShouldMatch() {
169169 @ Test
170170 void whenInstanceOfWhenValueIsNotTargetTypeShouldNotMatch () {
171171 Supplier <Number > supplier = () -> 123L ;
172- this .map .from (supplier ).whenInstanceOf (Double .class ).toCall (() -> fail () );
172+ this .map .from (supplier ).whenInstanceOf (Double .class ).toCall (Assertions :: fail );
173173 }
174174
175175 @ Test
@@ -180,7 +180,7 @@ void whenWhenValueMatchesShouldMap() {
180180
181181 @ Test
182182 void whenWhenValueDoesNotMatchShouldNotMap () {
183- this .map .from ("123" ).when ("321" ::equals ).toCall (() -> fail () );
183+ this .map .from ("123" ).when ("321" ::equals ).toCall (Assertions :: fail );
184184 }
185185
186186 @ Test
@@ -198,12 +198,12 @@ void whenWhenCombinedWithAsUsesSourceValue() {
198198
199199 @ Test
200200 void alwaysApplyingWhenNonNullShouldAlwaysApplyNonNullToSource () {
201- this .map .alwaysApplyingWhenNonNull ().from (() -> null ).toCall (() -> fail () );
201+ this .map .alwaysApplyingWhenNonNull ().from (() -> null ).toCall (Assertions :: fail );
202202 }
203203
204204 @ Test
205205 void whenWhenValueNotMatchesShouldSupportChainedCalls () {
206- this .map .from ("123" ).when ("456" ::equals ).when ("123" ::equals ).toCall (() -> fail () );
206+ this .map .from ("123" ).when ("456" ::equals ).when ("123" ::equals ).toCall (Assertions :: fail );
207207 }
208208
209209 @ Test
0 commit comments