Skip to content

Commit 06f172a

Browse files
committed
Initial commit (#151).
1 parent d4906b7 commit 06f172a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package org.gitlab4j.api;
2+
3+
import static org.junit.Assert.assertEquals;
4+
5+
import java.text.ParseException;
6+
import java.util.Date;
7+
8+
import org.gitlab4j.api.utils.ISO8601;
9+
import org.junit.Test;
10+
11+
public class TestISO8601 {
12+
13+
private static final String SPACEY_GITLAB_DATE = "2018-03-12 10:16:46 +0800";
14+
private static final String ISO8601_GITLAB_DATE ="2018-03-12T10:16:46+0800";
15+
16+
@Test
17+
public void testGitlabDateParse() throws ParseException {
18+
Date spaceyDate = ISO8601.toDate(SPACEY_GITLAB_DATE);
19+
Date gitlabDate = ISO8601.toDate(ISO8601_GITLAB_DATE);
20+
assertEquals(spaceyDate, gitlabDate);
21+
}
22+
}

0 commit comments

Comments
 (0)