|
3 | 3 | import org.junit.Test;
|
4 | 4 |
|
5 | 5 | import java.io.IOException;
|
| 6 | +import java.text.ParseException; |
| 7 | +import java.text.SimpleDateFormat; |
6 | 8 | import java.time.Instant;
|
7 | 9 | import java.time.LocalDate;
|
8 | 10 | import java.time.ZoneOffset;
|
9 | 11 | import java.time.format.DateTimeFormatter;
|
10 | 12 | import java.util.Arrays;
|
11 | 13 | import java.util.Collections;
|
| 14 | +import java.util.Date; |
12 | 15 | import java.util.HashMap;
|
13 | 16 | import java.util.List;
|
14 | 17 | import java.util.Map;
|
| 18 | +import java.util.TimeZone; |
15 | 19 |
|
16 | 20 | import static org.hamcrest.Matchers.*;
|
17 | 21 |
|
@@ -115,11 +119,15 @@ public void listInstallations() throws IOException {
|
115 | 119 | *
|
116 | 120 | * @throws IOException
|
117 | 121 | * Signals that an I/O exception has occurred.
|
| 122 | + * @throws ParseException |
118 | 123 | *
|
119 | 124 | */
|
120 | 125 | @Test
|
121 |
| - public void listInstallationsSince() throws IOException { |
122 |
| - Instant localDate = LocalDate.parse("2023-11-01", DateTimeFormatter.ISO_LOCAL_DATE) |
| 126 | + public void listInstallationsSince() throws IOException, ParseException { |
| 127 | + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| 128 | + simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); |
| 129 | + Date localDate = simpleDateFormat.parse("2023-11-01"); |
| 130 | + Instant localInstant = LocalDate.parse("2023-11-01", DateTimeFormatter.ISO_LOCAL_DATE) |
123 | 131 | .atStartOfDay()
|
124 | 132 | .toInstant(ZoneOffset.UTC);
|
125 | 133 | GHApp app = gitHub.getApp();
|
@@ -293,7 +301,7 @@ private void testAppInstallation(GHAppInstallation appInstallation) throws IOExc
|
293 | 301 |
|
294 | 302 | List<GHEvent> events = Arrays.asList(GHEvent.PULL_REQUEST, GHEvent.PUSH);
|
295 | 303 | assertThat(appInstallation.getEvents(), containsInAnyOrder(events.toArray(new GHEvent[0])));
|
296 |
| - assertThat(appInstallation.getCreatedAt(), is(GitHubClient.parseInstant("2019-07-04T01:19:36.000Z"))); |
| 304 | + assertThat(appInstallation.getCreatedAt(), is(GitHubClient.parseDate("2019-07-04T01:19:36.000Z").toInstant())); |
297 | 305 | assertThat(appInstallation.getUpdatedAt(), is(GitHubClient.parseInstant("2019-07-30T22:48:09.000Z")));
|
298 | 306 | assertThat(appInstallation.getSingleFileName(), nullValue());
|
299 | 307 | }
|
|
0 commit comments