Skip to content

Commit c962b37

Browse files
committed
Better name for callback convenience method
1 parent 53d1476 commit c962b37

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/main/java/org/mybatis/dynamic/sql/Callback.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
public interface Callback {
2222
void call();
2323

24-
static Callback runtimeExceptionThrowingCallback(String message) {
24+
static Callback exceptionThrowingCallback(String message) {
2525
return exceptionThrowingCallback(message, RuntimeException::new);
2626
}
2727

src/test/java/examples/animal/data/AnimalDataTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ void testInConditionWithEmptyList() {
621621
}
622622

623623
private static <T> IsIn<T> isInRequired(Collection<T> values) {
624-
return IsIn.of(values).withListEmptyCallback(Callback.runtimeExceptionThrowingCallback("Fred"));
624+
return IsIn.of(values).withListEmptyCallback(Callback.exceptionThrowingCallback("Fred"));
625625
}
626626

627627
@Test
@@ -721,7 +721,7 @@ void testNotInConditionWithEventuallyEmptyListForceRendering() {
721721

722722
@SafeVarargs
723723
private static <T> IsNotIn<T> isNotInRequired(T...values) {
724-
return IsNotIn.of(Arrays.asList(values)).withListEmptyCallback(Callback.runtimeExceptionThrowingCallback("Fred"));
724+
return IsNotIn.of(Arrays.asList(values)).withListEmptyCallback(Callback.exceptionThrowingCallback("Fred"));
725725
}
726726

727727
@Test

src/test/java/org/mybatis/dynamic/sql/select/SelectStatementTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ void testInCaseInsensitiveEmptyList() {
267267
SelectModel selectModel = select(column1, column3)
268268
.from(table, "a")
269269
.where(column3, isInCaseInsensitive(Collections.emptyList())
270-
.withListEmptyCallback(Callback.runtimeExceptionThrowingCallback("Fred")))
270+
.withListEmptyCallback(Callback.exceptionThrowingCallback("Fred")))
271271
.build();
272272

273273
assertThatExceptionOfType(RuntimeException.class).describedAs("Fred").isThrownBy(() ->
@@ -280,7 +280,7 @@ void testInCaseInsensitiveWhenPresentEmptyList() {
280280
SelectModel selectModel = select(column1, column3)
281281
.from(table, "a")
282282
.where(column3, isInCaseInsensitiveWhenPresent(Collections.emptyList())
283-
.withListEmptyCallback(Callback.runtimeExceptionThrowingCallback("Fred")))
283+
.withListEmptyCallback(Callback.exceptionThrowingCallback("Fred")))
284284
.build();
285285

286286
assertThatExceptionOfType(RuntimeException.class).describedAs("Fred").isThrownBy(() ->
@@ -293,7 +293,7 @@ void testNotInCaseInsensitiveEmptyList() {
293293
SelectModel selectModel = select(column1, column3)
294294
.from(table, "a")
295295
.where(column3, isNotInCaseInsensitive(Collections.emptyList())
296-
.withListEmptyCallback(Callback.runtimeExceptionThrowingCallback("Fred")))
296+
.withListEmptyCallback(Callback.exceptionThrowingCallback("Fred")))
297297
.build();
298298

299299
assertThatExceptionOfType(RuntimeException.class).describedAs("Fred").isThrownBy(() ->
@@ -306,7 +306,7 @@ void testNotInCaseInsensitiveWhenPresentEmptyList() {
306306
SelectModel selectModel = select(column1, column3)
307307
.from(table, "a")
308308
.where(column3, isNotInCaseInsensitiveWhenPresent(Collections.emptyList())
309-
.withListEmptyCallback(Callback.runtimeExceptionThrowingCallback("Fred")))
309+
.withListEmptyCallback(Callback.exceptionThrowingCallback("Fred")))
310310
.build();
311311

312312
assertThatExceptionOfType(RuntimeException.class).describedAs("Fred").isThrownBy(() ->

0 commit comments

Comments
 (0)