Adobe-Marketing-Cloud / aem-sample-we-retail

🚫 We.Retail has been archived, see instead the WKND Guide:
https://github.com/adobe/aem-guides-wknd
Apache License 2.0
123 stars 141 forks source link

Fixing build issue in Order tests #140

Closed aaherbil closed 6 years ago

aaherbil commented 6 years ago

Hi,

I created this simple pull request because I'm getting a build failure in Order tests in we.retail.core.model package.

The issue is that the dates are defined with an US Locale (Sun Dec...), SimpleDateFormat instead is expecting a French Locale ( I have a French laptop ... ). in this case the Parser com.day.cq.dam.commons.util.DateParser returns a null.

In code Sun Dec 11 2016 16:42:15 GMT+0100 SimpleDateFormat expects dim. déc. 11 2016 16:42:15 GMT+0100

My build stack trace

capture d ecran 2017-10-01 a 19 21 44

The fix i did is to remove the call for DateParser and use instead a static dateFormat with a fixed Locale.US to match the org.apache.sling.testing.mock.sling.loader.ContentLoader class which is used in those tests to loads json files.

Kind Regards Abdellah.