@@ -171,7 +171,7 @@ class APIGatewayLambdaAuthorizerTests: XCTestCase {
171
171
XCTAssertNoThrow ( data = try JSONEncoder ( ) . encode ( resp) )
172
172
173
173
var stringData : String ?
174
- XCTAssertNoThrow ( stringData = String ( data: try XCTUnwrap ( data) , encoding: . utf8) )
174
+ XCTAssertNoThrow ( stringData = try String ( data: XCTUnwrap ( data) , encoding: . utf8) )
175
175
176
176
data = stringData? . data ( using: . utf8)
177
177
XCTAssertNoThrow ( resp = try JSONDecoder ( ) . decode ( APIGatewayLambdaAuthorizerSimpleResponse . self, from: XCTUnwrap ( data) ) )
@@ -194,7 +194,7 @@ class APIGatewayLambdaAuthorizerTests: XCTestCase {
194
194
XCTAssertNoThrow ( data = try JSONEncoder ( ) . encode ( resp) )
195
195
196
196
var stringData : String ?
197
- XCTAssertNoThrow ( stringData = String ( data: try XCTUnwrap ( data) , encoding: . utf8) )
197
+ XCTAssertNoThrow ( stringData = try String ( data: XCTUnwrap ( data) , encoding: . utf8) )
198
198
199
199
data = stringData? . data ( using: . utf8)
200
200
XCTAssertNoThrow ( resp = try JSONDecoder ( ) . decode ( APIGatewayLambdaAuthorizerPolicyResponse . self, from: XCTUnwrap ( data) ) )
@@ -205,13 +205,13 @@ class APIGatewayLambdaAuthorizerTests: XCTestCase {
205
205
XCTAssertEqual ( resp. context? . count, 2 )
206
206
XCTAssertEqual ( resp. context ? [ " abc1 " ] , " xyz1 " )
207
207
}
208
-
208
+
209
209
func testDecodingLambdaAuthorizerPolicyResponseWithMultipleResources( ) {
210
210
let statement = APIGatewayLambdaAuthorizerPolicyResponse . PolicyDocument. Statement ( action: [ " execute-api:Invoke " ] ,
211
211
effect: . allow,
212
212
resource: [
213
- " arn:aws:execute-api:*:*:*/*/GET/v1/user/0123 " ,
214
- " arn:aws:execute-api:*:*:*/*/POST/v1/user " ,
213
+ " arn:aws:execute-api:*:*:*/*/GET/v1/user/0123 " ,
214
+ " arn:aws:execute-api:*:*:*/*/POST/v1/user " ,
215
215
] )
216
216
let policy = APIGatewayLambdaAuthorizerPolicyResponse . PolicyDocument ( statement: [ statement] )
217
217
var resp = APIGatewayLambdaAuthorizerPolicyResponse ( principalId: " John Appleseed " ,
@@ -222,7 +222,7 @@ class APIGatewayLambdaAuthorizerTests: XCTestCase {
222
222
XCTAssertNoThrow ( data = try JSONEncoder ( ) . encode ( resp) )
223
223
224
224
var stringData : String ?
225
- XCTAssertNoThrow ( stringData = String ( data: try XCTUnwrap ( data) , encoding: . utf8) )
225
+ XCTAssertNoThrow ( stringData = try String ( data: XCTUnwrap ( data) , encoding: . utf8) )
226
226
227
227
data = stringData? . data ( using: . utf8)
228
228
XCTAssertNoThrow ( resp = try JSONDecoder ( ) . decode ( APIGatewayLambdaAuthorizerPolicyResponse . self, from: XCTUnwrap ( data) ) )
@@ -233,7 +233,7 @@ class APIGatewayLambdaAuthorizerTests: XCTestCase {
233
233
XCTAssertEqual ( resp. policyDocument. statement [ 0 ] . resource, [
234
234
" arn:aws:execute-api:*:*:*/*/GET/v1/user/0123 " ,
235
235
" arn:aws:execute-api:*:*:*/*/POST/v1/user " ,
236
- ] )
236
+ ] )
237
237
XCTAssertEqual ( resp. context? . count, 2 )
238
238
XCTAssertEqual ( resp. context ? [ " abc1 " ] , " xyz1 " )
239
239
}
0 commit comments