From c14cbd07f449d845269c99faa29241e7e2d0dfc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deleuze?= Date: Wed, 2 Nov 2022 12:01:49 +0100 Subject: [PATCH] Use non-null DateFormat for CustomDateEditor in tests Closes gh-29419 --- .../beans/propertyeditors/CustomEditorTests.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-beans/src/test/java/org/springframework/beans/propertyeditors/CustomEditorTests.java b/spring-beans/src/test/java/org/springframework/beans/propertyeditors/CustomEditorTests.java index e3dddf62db2..696e3088583 100644 --- a/spring-beans/src/test/java/org/springframework/beans/propertyeditors/CustomEditorTests.java +++ b/spring-beans/src/test/java/org/springframework/beans/propertyeditors/CustomEditorTests.java @@ -722,7 +722,7 @@ class CustomEditorTests { @Test void testCustomDateEditor() { - CustomDateEditor editor = new CustomDateEditor(null, false); + CustomDateEditor editor = new CustomDateEditor(new SimpleDateFormat("MM/dd/yyyy"), false); editor.setValue(null); assertThat(editor.getValue()).isNull(); assertThat(editor.getAsText()).isEmpty(); @@ -730,7 +730,7 @@ class CustomEditorTests { @Test void testCustomDateEditorWithEmptyAsNull() { - CustomDateEditor editor = new CustomDateEditor(null, true); + CustomDateEditor editor = new CustomDateEditor(new SimpleDateFormat("MM/dd/yyyy"), true); editor.setValue(null); assertThat(editor.getValue()).isNull(); assertThat(editor.getAsText()).isEmpty();