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 Order tests. #139

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 English 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 locale from dates which in my opinion is not used here.

An other solution mybe to not use aem Parser and instead use SimpleDateFormat with fixed English locale. like new SimpleDateFormat("EEE MMM dd yyyy HH:mm:ss \'GMT\'Z", Locale.ENGLISH)

Kind Regards Abdellah.