Add additional LinkPreviewUtil unit tests.

Also updated the date format -- funnily enough Android will work with
either Z or X in the format, but the test JVM will fail if it doesn't
use X. X is definitely the correct thing to use based on the Javadoc, I
think Android's implementation is just a little more lenient.
This commit is contained in:
Greyson Parrelli
2020-08-27 09:32:25 -04:00
parent 3a9a84a0b1
commit b1befbeefc
2 changed files with 72 additions and 8 deletions

View File

@@ -200,7 +200,7 @@ public final class LinkPreviewUtil {
}
public long getDate() {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ", Locale.getDefault());
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssX", Locale.getDefault());
return Stream.of(values.get(KEY_PUBLISHED_TIME_1),
values.get(KEY_PUBLISHED_TIME_2),