Freeman Yue Fang created CAMEL-21531:
----------------------------------------
Summary: RestOpenApiReaderTest is broken for some locations
Key: CAMEL-21531
URL: https://issues.apache.org/jira/browse/CAMEL-21531
Project: Camel
Issue Type: Bug
Reporter: Freeman Yue Fang
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)