1
1
/*
2
- * Copyright 2012-2023 the original author or authors.
2
+ * Copyright 2012-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -57,7 +57,7 @@ void fromValueAsIntShouldAdaptValue() {
57
57
58
58
@ Test
59
59
void fromValueAlwaysApplyingWhenNonNullShouldAlwaysApplyNonNullToSource () {
60
- this .map .alwaysApplyingWhenNonNull ().from ((String ) null ).toCall (() -> fail (null ));
60
+ this .map .alwaysApplyingWhenNonNull ().from ((String ) null ).toCall (() -> fail ());
61
61
}
62
62
63
63
@ Test
@@ -101,14 +101,14 @@ void asShouldAdaptSupplier() {
101
101
102
102
@ Test
103
103
void whenNonNullWhenSuppliedNullShouldNotMap () {
104
- this .map .from (() -> null ).whenNonNull ().as (String ::valueOf ).toCall (() -> fail (null ));
104
+ this .map .from (() -> null ).whenNonNull ().as (String ::valueOf ).toCall (() -> fail ());
105
105
}
106
106
107
107
@ Test
108
108
void whenNonNullWhenSuppliedThrowsNullPointerExceptionShouldNotMap () {
109
109
this .map .from (() -> {
110
110
throw new NullPointerException ();
111
- }).whenNonNull ().as (String ::valueOf ).toCall (() -> fail (null ));
111
+ }).whenNonNull ().as (String ::valueOf ).toCall (() -> fail ());
112
112
}
113
113
114
114
@ Test
@@ -119,7 +119,7 @@ void whenTrueWhenValueIsTrueShouldMap() {
119
119
120
120
@ Test
121
121
void whenTrueWhenValueIsFalseShouldNotMap () {
122
- this .map .from (false ).whenTrue ().toCall (() -> fail (null ));
122
+ this .map .from (false ).whenTrue ().toCall (() -> fail ());
123
123
}
124
124
125
125
@ Test
@@ -130,17 +130,17 @@ void whenFalseWhenValueIsFalseShouldMap() {
130
130
131
131
@ Test
132
132
void whenFalseWhenValueIsTrueShouldNotMap () {
133
- this .map .from (true ).whenFalse ().toCall (() -> fail (null ));
133
+ this .map .from (true ).whenFalse ().toCall (() -> fail ());
134
134
}
135
135
136
136
@ Test
137
137
void whenHasTextWhenValueIsNullShouldNotMap () {
138
- this .map .from (() -> null ).whenHasText ().toCall (() -> fail (null ));
138
+ this .map .from (() -> null ).whenHasText ().toCall (() -> fail ());
139
139
}
140
140
141
141
@ Test
142
142
void whenHasTextWhenValueIsEmptyShouldNotMap () {
143
- this .map .from ("" ).whenHasText ().toCall (() -> fail (null ));
143
+ this .map .from ("" ).whenHasText ().toCall (() -> fail ());
144
144
}
145
145
146
146
@ Test
@@ -157,7 +157,7 @@ void whenEqualToWhenValueIsEqualShouldMatch() {
157
157
158
158
@ Test
159
159
void whenEqualToWhenValueIsNotEqualShouldNotMatch () {
160
- this .map .from ("123" ).whenEqualTo ("321" ).toCall (() -> fail (null ));
160
+ this .map .from ("123" ).whenEqualTo ("321" ).toCall (() -> fail ());
161
161
}
162
162
163
163
@ Test
@@ -169,7 +169,7 @@ void whenInstanceOfWhenValueIsTargetTypeShouldMatch() {
169
169
@ Test
170
170
void whenInstanceOfWhenValueIsNotTargetTypeShouldNotMatch () {
171
171
Supplier <Number > supplier = () -> 123L ;
172
- this .map .from (supplier ).whenInstanceOf (Double .class ).toCall (() -> fail (null ));
172
+ this .map .from (supplier ).whenInstanceOf (Double .class ).toCall (() -> fail ());
173
173
}
174
174
175
175
@ Test
@@ -180,7 +180,7 @@ void whenWhenValueMatchesShouldMap() {
180
180
181
181
@ Test
182
182
void whenWhenValueDoesNotMatchShouldNotMap () {
183
- this .map .from ("123" ).when ("321" ::equals ).toCall (() -> fail (null ));
183
+ this .map .from ("123" ).when ("321" ::equals ).toCall (() -> fail ());
184
184
}
185
185
186
186
@ Test
@@ -198,12 +198,12 @@ void whenWhenCombinedWithAsUsesSourceValue() {
198
198
199
199
@ Test
200
200
void alwaysApplyingWhenNonNullShouldAlwaysApplyNonNullToSource () {
201
- this .map .alwaysApplyingWhenNonNull ().from (() -> null ).toCall (() -> fail (null ));
201
+ this .map .alwaysApplyingWhenNonNull ().from (() -> null ).toCall (() -> fail ());
202
202
}
203
203
204
204
@ Test
205
205
void whenWhenValueNotMatchesShouldSupportChainedCalls () {
206
- this .map .from ("123" ).when ("456" ::equals ).when ("123" ::equals ).toCall (() -> fail (null ));
206
+ this .map .from ("123" ).when ("456" ::equals ).when ("123" ::equals ).toCall (() -> fail ());
207
207
}
208
208
209
209
@ Test
0 commit comments