@@ -69,7 +69,10 @@ final class APIClientTests: XCTestCase {
69
69
70
70
// Then: Should not throw an error and return a valid response
71
71
do {
72
- let result : Session = try await request. serializingDecodable ( Session . self) . value
72
+ let result : Session = try await request. serializingDecodable (
73
+ Session . self,
74
+ decoder: AuthClient . Configuration. jsonDecoder
75
+ ) . value
73
76
XCTAssertNotNil ( result)
74
77
XCTAssertNotNil ( result. accessToken)
75
78
XCTAssertNotNil ( result. refreshToken)
@@ -112,7 +115,8 @@ final class APIClientTests: XCTestCase {
112
115
let errorMessage = String ( describing: error)
113
116
XCTAssertTrue (
114
117
errorMessage. contains ( " Invalid refresh token " )
115
- || errorMessage. contains ( " invalid_grant " ) )
118
+ || errorMessage. contains ( " invalid_grant " )
119
+ )
116
120
}
117
121
}
118
122
@@ -139,7 +143,10 @@ final class APIClientTests: XCTestCase {
139
143
140
144
// Then: Should not throw an error
141
145
do {
142
- let result : Session = try await request. serializingDecodable ( Session . self) . value
146
+ let result : Session = try await request. serializingDecodable (
147
+ Session . self,
148
+ decoder: AuthClient . Configuration. jsonDecoder
149
+ ) . value
143
150
XCTAssertNotNil ( result)
144
151
} catch {
145
152
XCTFail ( " Expected successful response, got error: \( error) " )
@@ -170,7 +177,10 @@ final class APIClientTests: XCTestCase {
170
177
171
178
// Then: Should not throw an error
172
179
do {
173
- let result : Session = try await request. serializingDecodable ( Session . self) . value
180
+ let result : Session = try await request. serializingDecodable (
181
+ Session . self,
182
+ decoder: AuthClient . Configuration. jsonDecoder
183
+ ) . value
174
184
XCTAssertNotNil ( result)
175
185
} catch {
176
186
XCTFail ( " Expected successful response, got error: \( error) " )
@@ -200,7 +210,10 @@ final class APIClientTests: XCTestCase {
200
210
201
211
// Then: Should not throw an error
202
212
do {
203
- let postResult : Session = try await postRequest. serializingDecodable ( Session . self) . value
213
+ let postResult : Session = try await postRequest. serializingDecodable (
214
+ Session . self,
215
+ decoder: AuthClient . Configuration. jsonDecoder
216
+ ) . value
204
217
XCTAssertNotNil ( postResult)
205
218
} catch {
206
219
XCTFail ( " Expected successful response, got error: \( error) " )
@@ -255,7 +268,10 @@ final class APIClientTests: XCTestCase {
255
268
256
269
// Then: Should not throw an error after delay
257
270
do {
258
- let result : Session = try await request. serializingDecodable ( Session . self) . value
271
+ let result : Session = try await request. serializingDecodable (
272
+ Session . self,
273
+ decoder: AuthClient . Configuration. jsonDecoder
274
+ ) . value
259
275
XCTAssertNotNil ( result)
260
276
} catch {
261
277
XCTFail ( " Expected successful response, got error: \( error) " )
0 commit comments