From 457d29a58b01c58d32b8208d1f74eb1dfca4a37e Mon Sep 17 00:00:00 2001 From: Jon Chambers Date: Sat, 9 May 2020 15:33:28 -0400 Subject: [PATCH] Fixed some precision issues that were causing test failures in newer JDKs. --- .../src/test/java/com/eatthepath/pushy/apns/ApnsClientTest.java | 2 +- .../test/java/com/eatthepath/pushy/apns/ErrorResponseTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pushy/src/test/java/com/eatthepath/pushy/apns/ApnsClientTest.java b/pushy/src/test/java/com/eatthepath/pushy/apns/ApnsClientTest.java index 72f29d54f..8745ffa2c 100644 --- a/pushy/src/test/java/com/eatthepath/pushy/apns/ApnsClientTest.java +++ b/pushy/src/test/java/com/eatthepath/pushy/apns/ApnsClientTest.java @@ -493,7 +493,7 @@ void testSendNotificationWithExpiredDeviceToken(final boolean useTokenAuthentica assertFalse(response.isAccepted()); assertEquals("Unregistered", response.getRejectionReason()); - assertEquals(expiration, response.getTokenInvalidationTimestamp()); + assertEquals(expiration.toEpochMilli(), response.getTokenInvalidationTimestamp().toEpochMilli()); } finally { client.close().get(); server.shutdown().get(); diff --git a/pushy/src/test/java/com/eatthepath/pushy/apns/ErrorResponseTest.java b/pushy/src/test/java/com/eatthepath/pushy/apns/ErrorResponseTest.java index c02575388..bf6772d30 100644 --- a/pushy/src/test/java/com/eatthepath/pushy/apns/ErrorResponseTest.java +++ b/pushy/src/test/java/com/eatthepath/pushy/apns/ErrorResponseTest.java @@ -64,7 +64,7 @@ void fromMap() { final ErrorResponse errorResponse = ErrorResponse.fromMap(errorResponseMap); assertEquals(reason, errorResponse.getReason()); - assertEquals(timestamp, errorResponse.getTimestamp()); + assertEquals(timestamp.toEpochMilli(), errorResponse.getTimestamp().toEpochMilli()); } {