RED-9667 - Extend convert dates
This commit is contained in:
parent
c479df124d
commit
1397290a0e
@ -14,6 +14,8 @@ dd MMMM yyyy
|
||||
d MMMM yyyy
|
||||
MMMM dd, yyyy
|
||||
MMMM d, yyyy
|
||||
MMMM, d yyyy
|
||||
MMMM d,yyyy
|
||||
dd.MM.yyyy
|
||||
d.MM.yyyy
|
||||
yyyy/MM/dd
|
||||
|
||||
@ -137,6 +137,10 @@ public class DocumineFloraTest extends AbstractRedactionIntegrationTest {
|
||||
expectedDates.add("03/08/1992");
|
||||
expectedDates.add("13/08/1992");
|
||||
expectedDates.add("27/02/1992");
|
||||
expectedDates.add("27/10/1989");
|
||||
expectedDates.add("07/10/1989");
|
||||
expectedDates.add("21/08/1998");
|
||||
expectedDates.add("02/08/1998");
|
||||
|
||||
String dates = experimentalDates.getComponentValues()
|
||||
.get(0).getValue();
|
||||
|
||||
@ -1,12 +1,11 @@
|
||||
package com.iqser.red.service.redaction.v1.server.date;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import com.iqser.red.service.redaction.v1.server.utils.DateConverter;
|
||||
@ -17,33 +16,36 @@ public class DateConverterTest {
|
||||
public void testDateConverter() {
|
||||
|
||||
List<String> goldenStandardDates = Arrays.asList("3 Jun 08",
|
||||
"09. Apr 09",
|
||||
"07-Sep-2010",
|
||||
"26-FEB-2008",
|
||||
"30-APR-2008",
|
||||
"30-apr-2008",
|
||||
"30-Apr-2008",
|
||||
"1 Apr 08",
|
||||
"26-FEB-2008",
|
||||
"19-MAR-2008",
|
||||
"1 Apr 08",
|
||||
"27-MAR-2008",
|
||||
"06-MAY-2008",
|
||||
"3 Apr 08",
|
||||
"12-MAR-2008",
|
||||
"08-APR-2008",
|
||||
"1 Apr 08",
|
||||
"4 Apr 08",
|
||||
"13 November 2017 (animal 1)",
|
||||
"16 November 2017 (animal 1)",
|
||||
"27 March 2018 (animal 1 - 5000 mg/kg bw)",
|
||||
"10 April 2018 (animal 1 - 5000 mg/kg bw)",
|
||||
"13 November 2017 (animal 1)",
|
||||
"16 November 2017 (animal 1)",
|
||||
"28 March 2018 (animal 1 - 5000 mg/kg bw)",
|
||||
"28 March 2018 (animal1 - 5000 mg/kg bw)",
|
||||
"28 August 2018 (animal 1)",
|
||||
"31 August 2018 (animal 1)");
|
||||
"09. Apr 09",
|
||||
"07-Sep-2010",
|
||||
"26-FEB-2008",
|
||||
"30-APR-2008",
|
||||
"30-apr-2008",
|
||||
"30-Apr-2008",
|
||||
"1 Apr 08",
|
||||
"26-FEB-2008",
|
||||
"19-MAR-2008",
|
||||
"1 Apr 08",
|
||||
"27-MAR-2008",
|
||||
"06-MAY-2008",
|
||||
"3 Apr 08",
|
||||
"12-MAR-2008",
|
||||
"08-APR-2008",
|
||||
"1 Apr 08",
|
||||
"4 Apr 08",
|
||||
"13 November 2017 (animal 1)",
|
||||
"16 November 2017 (animal 1)",
|
||||
"27 March 2018 (animal 1 - 5000 mg/kg bw)",
|
||||
"10 April 2018 (animal 1 - 5000 mg/kg bw)",
|
||||
"13 November 2017 (animal 1)",
|
||||
"16 November 2017 (animal 1)",
|
||||
"28 March 2018 (animal 1 - 5000 mg/kg bw)",
|
||||
"28 March 2018 (animal1 - 5000 mg/kg bw)",
|
||||
"28 August 2018 (animal 1)",
|
||||
"October, 27 1989",
|
||||
"October, 7 1989",
|
||||
"August 21,1998",
|
||||
"August 2,1998");
|
||||
|
||||
for (String dateStr : goldenStandardDates) {
|
||||
Optional<Date> parsedDate = DateConverter.parseDate(dateStr);
|
||||
|
||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user