summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMehdi Javan <32511762+mehdi-vaadin@users.noreply.github.com>2018-06-28 12:25:28 +0300
committerTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2018-07-04 11:41:36 +0300
commitbea01cb0ea4801d3690df99186914e697053ac73 (patch)
treee78d0d4a070ef4bbc71c28471ca95285df429d32
parenta2457b2f2357bbdb32b184e25ddd49698efc800e (diff)
downloadvaadin-framework-bea01cb0ea4801d3690df99186914e697053ac73.tar.gz
vaadin-framework-bea01cb0ea4801d3690df99186914e697053ac73.zip
Fix DateFieldUnparseableString test UI (#11004)
This patch eliminates the use of Apache Commons StringUtils in the test UI.
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldUnparsableDateString.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldUnparsableDateString.java b/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldUnparsableDateString.java
index c6147cda79..c8c5abb979 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldUnparsableDateString.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/datefield/DateFieldUnparsableDateString.java
@@ -4,7 +4,6 @@ import com.vaadin.data.Result;
import com.vaadin.server.VaadinRequest;
import com.vaadin.tests.components.AbstractTestUI;
import com.vaadin.ui.DateField;
-import org.apache.commons.lang3.StringUtils;
import java.time.LocalDate;
import java.time.Year;
@@ -31,7 +30,8 @@ public class DateFieldUnparsableDateString extends AbstractTestUI {
protected Result<LocalDate> handleUnparsableDateString(
String dateString) {
try {
- String parseableString = StringUtils.remove(dateString, ' ');
+ String parseableString = dateString == null ? ""
+ : dateString.replaceAll(" ", "");
if (parseableString.length() % 2 == 1) {
parseableString = "0" + parseableString;
}
@@ -66,12 +66,9 @@ public class DateFieldUnparsableDateString extends AbstractTestUI {
.toFormatter()));
case 8:
// Long year ddMMyyyy
- parseableString = StringUtils.leftPad(dateString, 8, "0");
- return Result
- .ok(LocalDate.parse(parseableString,
- new DateTimeFormatterBuilder()
- .appendPattern("ddMMyyyy")
- .toFormatter()));
+ return Result.ok(LocalDate.parse(parseableString,
+ new DateTimeFormatterBuilder()
+ .appendPattern("ddMMyyyy").toFormatter()));
default:
break;
}