Skip to content

Commit c14cbd0

Browse files
committed
Use non-null DateFormat for CustomDateEditor in tests
Closes gh-29419
1 parent 58bb6e7 commit c14cbd0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-beans/src/test/java/org/springframework/beans/propertyeditors/CustomEditorTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -722,15 +722,15 @@ void testCustomBooleanEditorWithEmptyAsNull() {
722722

723723
@Test
724724
void testCustomDateEditor() {
725-
CustomDateEditor editor = new CustomDateEditor(null, false);
725+
CustomDateEditor editor = new CustomDateEditor(new SimpleDateFormat("MM/dd/yyyy"), false);
726726
editor.setValue(null);
727727
assertThat(editor.getValue()).isNull();
728728
assertThat(editor.getAsText()).isEmpty();
729729
}
730730

731731
@Test
732732
void testCustomDateEditorWithEmptyAsNull() {
733-
CustomDateEditor editor = new CustomDateEditor(null, true);
733+
CustomDateEditor editor = new CustomDateEditor(new SimpleDateFormat("MM/dd/yyyy"), true);
734734
editor.setValue(null);
735735
assertThat(editor.getValue()).isNull();
736736
assertThat(editor.getAsText()).isEmpty();

0 commit comments

Comments
 (0)