|
22 | 22 | import static org.junit.Assert.assertEquals; |
23 | 23 | import static org.junit.Assert.assertNotNull; |
24 | 24 | import java.time.ZonedDateTime; |
25 | | - |
26 | | - |
| 25 | +import java.time.format.DateTimeFormatter; |
| 26 | +import java.time.ZoneOffset; |
27 | 27 |
|
28 | 28 | /** |
29 | 29 | * API tests for MessagesApi |
@@ -155,10 +155,10 @@ public void sendMessagesTest() { |
155 | 155 |
|
156 | 156 | Integer retryTimeout = 10; |
157 | 157 |
|
158 | | - String scheduleSend = "2024-08-15T20:48:47.096Z"; |
159 | | - ZonedDateTime zdt = ZonedDateTime.parse(scheduleSend); |
| 158 | + ZonedDateTime zdt = ZonedDateTime.now(ZoneOffset.UTC); |
160 | 159 | ZonedDateTime zdtPlusTwoDays = zdt.plusDays(2); |
161 | | - scheduleSend = zdtPlusTwoDays.toString(); |
| 160 | + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSX"); |
| 161 | + String scheduleSend = zdtPlusTwoDays.format(formatter); |
162 | 162 |
|
163 | 163 | Boolean deliveryNotification = false; |
164 | 164 | String statusCallbackUrl = "http://www.example.com"; |
@@ -229,10 +229,10 @@ public void updateMessageByIdTest() { |
229 | 229 |
|
230 | 230 | Integer retryTimeout = 10; |
231 | 231 |
|
232 | | - String scheduleSend = "2024-08-15T20:48:47.096Z"; |
233 | | - ZonedDateTime zdt = ZonedDateTime.parse(scheduleSend); |
| 232 | + ZonedDateTime zdt = ZonedDateTime.now(ZoneOffset.UTC); |
234 | 233 | ZonedDateTime zdtPlusTwoDays = zdt.plusDays(2); |
235 | | - scheduleSend = zdtPlusTwoDays.toString(); |
| 234 | + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSX"); |
| 235 | + String scheduleSend = zdtPlusTwoDays.format(formatter); |
236 | 236 |
|
237 | 237 | Boolean deliveryNotification = false; |
238 | 238 | String statusCallbackUrl = "http://www.example.com"; |
|
0 commit comments