@@ -4,8 +4,8 @@ package events
44
55import (
66 "encoding/json"
7- "io/ioutil" //nolint: staticcheck
87 "testing"
8+ "os"
99
1010 "github.com/aws/aws-lambda-go/events/test"
1111 "github.com/stretchr/testify/assert"
@@ -14,7 +14,7 @@ import (
1414func TestApiGatewayRequestMarshaling (t * testing.T ) {
1515
1616 // read json from file
17- inputJSON , err := ioutil .ReadFile ("./testdata/apigw-request.json" )
17+ inputJSON , err := os .ReadFile ("./testdata/apigw-request.json" )
1818 if err != nil {
1919 t .Errorf ("could not open test file. details: %v" , err )
2020 }
@@ -49,7 +49,7 @@ func TestApiGatewayRequestMalformedJson(t *testing.T) {
4949func TestApiGatewayResponseMarshaling (t * testing.T ) {
5050
5151 // read json from file
52- inputJSON , err := ioutil .ReadFile ("./testdata/apigw-response.json" )
52+ inputJSON , err := os .ReadFile ("./testdata/apigw-response.json" )
5353 if err != nil {
5454 t .Errorf ("could not open test file. details: %v" , err )
5555 }
@@ -76,7 +76,7 @@ func TestApiGatewayResponseMalformedJson(t *testing.T) {
7676func TestApiGatewayCustomAuthorizerRequestMarshaling (t * testing.T ) {
7777
7878 // read json from file
79- inputJSON , err := ioutil .ReadFile ("./testdata/apigw-custom-auth-request.json" )
79+ inputJSON , err := os .ReadFile ("./testdata/apigw-custom-auth-request.json" )
8080 if err != nil {
8181 t .Errorf ("could not open test file. details: %v" , err )
8282 }
@@ -99,7 +99,7 @@ func TestApiGatewayCustomAuthorizerRequestMarshaling(t *testing.T) {
9999func TestApiGatewayCustomAuthorizerRequestTypeRequestMarshaling (t * testing.T ) {
100100
101101 // read json from file
102- inputJSON , err := ioutil .ReadFile ("./testdata/apigw-custom-auth-request-type-request.json" )
102+ inputJSON , err := os .ReadFile ("./testdata/apigw-custom-auth-request-type-request.json" )
103103 if err != nil {
104104 t .Errorf ("could not open test file. details: %v" , err )
105105 }
@@ -130,7 +130,7 @@ func TestApiGatewayCustomAuthorizerRequestTypeRequestMalformedJson(t *testing.T)
130130func TestApiGatewayWebsocketRequestMarshaling (t * testing.T ) {
131131
132132 // read json from file
133- inputJSON , err := ioutil .ReadFile ("./testdata/apigw-websocket-request.json" )
133+ inputJSON , err := os .ReadFile ("./testdata/apigw-websocket-request.json" )
134134 if err != nil {
135135 t .Errorf ("could not open test file. details: %v" , err )
136136 }
@@ -157,7 +157,7 @@ func TestApiGatewayWebsocketRequestMalformedJson(t *testing.T) {
157157func TestApiGatewayCustomAuthorizerResponseMarshaling (t * testing.T ) {
158158
159159 // read json from file
160- inputJSON , err := ioutil .ReadFile ("./testdata/apigw-custom-auth-response.json" )
160+ inputJSON , err := os .ReadFile ("./testdata/apigw-custom-auth-response.json" )
161161 if err != nil {
162162 t .Errorf ("could not open test file. details: %v" , err )
163163 }
@@ -245,7 +245,7 @@ func TestApiGatewayCustomAuthorizerResponseMalformedJson(t *testing.T) {
245245func TestApiGatewayRestApiOpenApiRequestMarshaling (t * testing.T ) {
246246
247247 // read json from file
248- inputJSON , err := ioutil .ReadFile ("./testdata/apigw-restapi-openapi-request.json" )
248+ inputJSON , err := os .ReadFile ("./testdata/apigw-restapi-openapi-request.json" )
249249 if err != nil {
250250 t .Errorf ("could not open test file. details: %v" , err )
251251 }
@@ -274,7 +274,7 @@ func TestApiGatewayRestApiOpenApiRequestMarshaling(t *testing.T) {
274274func TestApiGatewayV2HTTPRequestJWTAuthorizerMarshaling (t * testing.T ) {
275275
276276 // read json from file
277- inputJSON , err := ioutil .ReadFile ("./testdata/apigw-v2-request-jwt-authorizer.json" )
277+ inputJSON , err := os .ReadFile ("./testdata/apigw-v2-request-jwt-authorizer.json" )
278278 if err != nil {
279279 t .Errorf ("could not open test file. details: %v" , err )
280280 }
@@ -309,7 +309,7 @@ func TestApiGatewayV2HTTPRequestJWTAuthorizerMarshaling(t *testing.T) {
309309func TestApiGatewayV2HTTPRequestLambdaAuthorizerMarshaling (t * testing.T ) {
310310
311311 // read json from file
312- inputJSON , err := ioutil .ReadFile ("./testdata/apigw-v2-request-lambda-authorizer.json" )
312+ inputJSON , err := os .ReadFile ("./testdata/apigw-v2-request-lambda-authorizer.json" )
313313 if err != nil {
314314 t .Errorf ("could not open test file. details: %v" , err )
315315 }
@@ -344,7 +344,7 @@ func TestApiGatewayV2HTTPRequestLambdaAuthorizerMarshaling(t *testing.T) {
344344func TestApiGatewayV2HTTPRequestIAMMarshaling (t * testing.T ) {
345345
346346 // read json from file
347- inputJSON , err := ioutil .ReadFile ("./testdata/apigw-v2-request-iam.json" )
347+ inputJSON , err := os .ReadFile ("./testdata/apigw-v2-request-iam.json" )
348348 if err != nil {
349349 t .Errorf ("could not open test file. details: %v" , err )
350350 }
@@ -403,7 +403,7 @@ func TestApiGatewayV2HTTPRequestIAMMarshaling(t *testing.T) {
403403func TestApiGatewayV2HTTPRequestNoAuthorizerMarshaling (t * testing.T ) {
404404
405405 // read json from file
406- inputJSON , err := ioutil .ReadFile ("./testdata/apigw-v2-request-no-authorizer.json" )
406+ inputJSON , err := os .ReadFile ("./testdata/apigw-v2-request-no-authorizer.json" )
407407 if err != nil {
408408 t .Errorf ("could not open test file. details: %v" , err )
409409 }
@@ -436,7 +436,7 @@ func TestApiGatewayV2HTTPRequestNoAuthorizerMarshaling(t *testing.T) {
436436}
437437
438438func TestApiGatewayV2CustomAuthorizerV1RequestMarshaling (t * testing.T ) {
439- inputJSON , err := ioutil .ReadFile ("./testdata/apigw-v2-custom-authorizer-v1-request.json" )
439+ inputJSON , err := os .ReadFile ("./testdata/apigw-v2-custom-authorizer-v1-request.json" )
440440 if err != nil {
441441 t .Errorf ("could not open test file. details: %v" , err )
442442 }
@@ -457,7 +457,7 @@ func TestApiGatewayV2CustomAuthorizerV1RequestMarshaling(t *testing.T) {
457457}
458458
459459func TestApiGatewayV2CustomAuthorizerV2RequestMarshaling (t * testing.T ) {
460- inputJSON , err := ioutil .ReadFile ("./testdata/apigw-v2-custom-authorizer-v2-request.json" )
460+ inputJSON , err := os .ReadFile ("./testdata/apigw-v2-custom-authorizer-v2-request.json" )
461461 if err != nil {
462462 t .Errorf ("could not open test file. details: %v" , err )
463463 }
0 commit comments