@@ -57,12 +57,7 @@ class DecodeTests: XCTestCase {
5757 let jwt = " eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MjgxODg0OTF9.EW7k-8Mvnv0GpvOKJalFRLoCB3a3xGG3i7hAZZXNAz0 "
5858
5959 let claims = try JWT . decode ( jwt, algorithm: . hs256( " secret " . data ( using: . utf8) !) )
60-
61- if let expirationClaim = claims. expiration? . timeIntervalSince1970 {
62- XCTAssertEqual ( Int ( expirationClaim) , 1728188491 )
63- } else {
64- XCTFail ( )
65- }
60+ XCTAssertEqual ( claims. expiration? . timeIntervalSince1970, 1728188491 )
6661 }
6762
6863 func testUnexpiredClaimString( ) throws {
@@ -79,11 +74,7 @@ class DecodeTests: XCTestCase {
7974 let jwt = " eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE0MjgxODk3MjB9.jFT0nXAJvEwyG6R7CMJlzNJb7FtZGv30QRZpYam5cvs "
8075
8176 let claims = try JWT . decode ( jwt, algorithm: . hs256( " secret " . data ( using: . utf8) !) )
82- if let notBeforeClaim = claims. notBefore? . timeIntervalSince1970 {
83- XCTAssertEqual ( Int ( notBeforeClaim) , 1428189720 )
84- } else {
85- XCTFail ( )
86- }
77+ XCTAssertEqual ( claims. notBefore? . timeIntervalSince1970, 1428189720 )
8778 }
8879
8980 func testNotBeforeClaimString( ) throws {
@@ -110,11 +101,7 @@ class DecodeTests: XCTestCase {
110101 let jwt = " eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE0MjgxODk3MjB9.I_5qjRcCUZVQdABLwG82CSuu2relSdIyJOyvXWUAJh4 "
111102
112103 let claims = try JWT . decode ( jwt, algorithm: . hs256( " secret " . data ( using: . utf8) !) )
113- if let issuedAtClaim = claims. issuedAt? . timeIntervalSince1970 {
114- XCTAssertEqual ( Int ( issuedAtClaim) , 1428189720 )
115- } else {
116- XCTFail ( )
117- }
104+ XCTAssertEqual ( claims. issuedAt? . timeIntervalSince1970, 1428189720 )
118105 }
119106
120107 func testIssuedAtClaimInThePastString( ) throws {
0 commit comments