@@ -57,12 +57,7 @@ class DecodeTests: XCTestCase {
57
57
let jwt = " eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MjgxODg0OTF9.EW7k-8Mvnv0GpvOKJalFRLoCB3a3xGG3i7hAZZXNAz0 "
58
58
59
59
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 )
66
61
}
67
62
68
63
func testUnexpiredClaimString( ) throws {
@@ -79,11 +74,7 @@ class DecodeTests: XCTestCase {
79
74
let jwt = " eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE0MjgxODk3MjB9.jFT0nXAJvEwyG6R7CMJlzNJb7FtZGv30QRZpYam5cvs "
80
75
81
76
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 )
87
78
}
88
79
89
80
func testNotBeforeClaimString( ) throws {
@@ -110,11 +101,7 @@ class DecodeTests: XCTestCase {
110
101
let jwt = " eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE0MjgxODk3MjB9.I_5qjRcCUZVQdABLwG82CSuu2relSdIyJOyvXWUAJh4 "
111
102
112
103
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 )
118
105
}
119
106
120
107
func testIssuedAtClaimInThePastString( ) throws {
0 commit comments