|
12 | 12 | import java.text.SimpleDateFormat; |
13 | 13 | import java.util.Calendar; |
14 | 14 | import java.util.Locale; |
| 15 | +import java.util.TimeZone; |
15 | 16 |
|
16 | 17 | import org.junit.BeforeClass; |
17 | 18 | import org.junit.Ignore; |
@@ -42,6 +43,16 @@ public static void setUp() throws Exception { |
42 | 43 | extractor.fetchPage(); |
43 | 44 | } |
44 | 45 |
|
| 46 | + @Test |
| 47 | + public void testGetUploadDate() throws ParsingException, ParseException { |
| 48 | + final Calendar instance = Calendar.getInstance(); |
| 49 | + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.S'Z'"); |
| 50 | + sdf.setTimeZone(TimeZone.getTimeZone("GMT")); |
| 51 | + instance.setTime(sdf.parse("2018-10-01T10:52:46.396Z")); |
| 52 | + assertEquals(instance, requireNonNull(extractor.getUploadDate()).date()); |
| 53 | + |
| 54 | + } |
| 55 | + |
45 | 56 | @Test |
46 | 57 | public void testGetInvalidTimeStamp() throws ParsingException { |
47 | 58 | assertTrue(extractor.getTimeStamp() + "", |
@@ -89,15 +100,6 @@ public void testGetViewCount() throws ParsingException { |
89 | 100 | extractor.getViewCount() > 10); |
90 | 101 | } |
91 | 102 |
|
92 | | - @Ignore //fixme |
93 | | - @Test |
94 | | - public void testGetUploadDate() throws ParsingException, ParseException { |
95 | | - final Calendar instance = Calendar.getInstance(); |
96 | | - instance.setTime(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.S'Z'").parse("2018-10-01T11:52:46.396Z")); |
97 | | - assertEquals(instance, requireNonNull(extractor.getUploadDate()).date()); |
98 | | - |
99 | | - } |
100 | | - |
101 | 103 | @Test |
102 | 104 | public void testGetUploaderUrl() throws ParsingException { |
103 | 105 | assertIsSecureUrl(extractor.getUploaderUrl()); |
|
0 commit comments