You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Freeman Yue Fang (Jira)" <ji...@apache.org> on 2024/12/10 19:26:00 UTC

[jira] [Updated] (CAMEL-21531) RestOpenApiReaderTest is broken for some locations

     [ https://issues.apache.org/jira/browse/CAMEL-21531?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Freeman Yue Fang updated CAMEL-21531:
-------------------------------------
    Component/s: tests

> RestOpenApiReaderTest is broken for some locations
> --------------------------------------------------
>
>                 Key: CAMEL-21531
>                 URL: https://issues.apache.org/jira/browse/CAMEL-21531
>             Project: Camel
>          Issue Type: Bug
>          Components: tests
>            Reporter: Freeman Yue Fang
>            Priority: Minor
>
> This line in the code
> {code}
> assertTrue(json.contains("\"enum\" : [ \"2023-01-01\", \"2023-02-02\", \"2023-03-03\" ]"));
> {code}
> is broken for some time zones.
> Like there is no timezone for the date 2023-01-01, so GMT is used by default. But in RestOpenApiSupport, the 
> {code}
> public static DateFormat DEFAULT_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd");
> {code}
> So the local timezone where we run the test is used. Because the timezone differences with GMT, the expect return string after calling RestOpenApiSupport.getFromOpenAPI3 could be
> 2022-12-31 instead of 2023-01-01. Similarly for 2023-02-02 and 2023-03-03 in the test, could be one day before it.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)