Uploaded image for project: 'Apache Fineract'
  1. Apache Fineract
  2. FINERACT-1242

OfficeTest fails with java.time.format.DateTimeParseException: Text '2020-10-25' could not be parsed: Unable to obtain LocalDateTime from TemporalAccessor: {DayOfMonth=25, Year=2020},ISO resolved to 00:10 of type java.time.format.Parsed

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.5.0
    • Component/s: SDK
    • Labels:
      None

      Description

      The https://github.com/apache/fineract/blob/develop/fineract-client/src/test/java/org/apache/fineract/integrationtests/newstyle/OfficeTest.java currently fails the Fineract build on the develop branch, so build is currently broken.

      Note that this (new!) OfficeTest in fineract-client is not to be confused with the https://github.com/apache/fineract/blob/develop/fineract-provider/src/integrationTest/java/org/apache/fineract/integrationtests/OfficeIntegrationTest.java

      I've first noticed this on https://github.com/apache/fineract/pull/1464, but it actually has nothing to do with that PR, I can reliably locally reproduce this. It's very likely an impact of https://github.com/apache/fineract/pull/1179 for FINERACT-826.

      IMPORTANT: Note that, until Aleksandar Vidakovic finalizes https://github.com/apache/fineract/pull/1465 for FINERACT-1209, this (new!) OfficeTest, and the others like it, run against demo.fineract.dev instead of localhost, so in order to test the fix locally, you have to run it with -Dfineract.it.url=https://localhost:8443/fineract-provider/api/v1/, see org.apache.fineract.integrationtests.newstyle.IntegrationTest. For the same reason, this appears in the log on Error Reporting for fineract.dev (see FINERACT-932):

      java.time.format.DateTimeParseException: Text '2020-10-25' could not be parsed: Unable to obtain LocalDateTime from TemporalAccessor: {DayOfMonth=25, Year=2020},ISO resolved to 00:10 of type java.time.format.Parsed
      
              at java.time.format.DateTimeFormatter.createError (DateTimeFormatter.java:2017)
              at java.time.format.DateTimeFormatter.parse (DateTimeFormatter.java:1952)
              at java.time.LocalDateTime.parse (LocalDateTime.java:492)
              at org.apache.fineract.infrastructure.core.serialization.JsonParserHelper.convertDateTimeFrom (JsonParserHelper.java:476)
              at org.apache.fineract.infrastructure.core.serialization.JsonParserHelper.convertFrom (JsonParserHelper.java:462)
              at org.apache.fineract.infrastructure.core.serialization.JsonParserHelper.extractLocalDateNamed (JsonParserHelper.java:451)
              at org.apache.fineract.infrastructure.core.serialization.JsonParserHelper.extractLocalDateNamed (JsonParserHelper.java:376)
              at org.apache.fineract.infrastructure.core.serialization.FromJsonHelper.extractLocalDateNamed (FromJsonHelper.java:203)
              at org.apache.fineract.organisation.office.serialization.OfficeCommandFromApiJsonDeserializer.validateForCreate (OfficeCommandFromApiJsonDeserializer.java:75)
              at org.apache.fineract.organisation.office.service.OfficeWritePlatformServiceJpaRepositoryImpl.createOffice (OfficeWritePlatformServiceJpaRepositoryImpl.java:90)
      
      Caused by: java.time.DateTimeException: Unable to obtain LocalDateTime from TemporalAccessor: {DayOfMonth=25, Year=2020},ISO resolved to 00:10 of type java.time.format.Parsed
      
              at java.time.LocalDateTime.from (LocalDateTime.java:461)
              at java.time.format.Parsed.query (Parsed.java:235)
              at java.time.format.DateTimeFormatter.parse (DateTimeFormatter.java:1948

      So it seems that while "yyyy-mm-dd" was a valid date pattern while we were still using JODA Time, this pattern doesn't work anymore now after we switched to java.time.

      Percy Ashu or Awasum Yannick is this something one of you be willing to fix soon-ish? (Petri Tuomola FYI.)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vorburger Michael Vorburger
                Reporter:
                vorburger Michael Vorburger
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: