1515import com .amazonaws .serverless .proxy .spring .echoapp .model .MapResponseModel ;
1616import com .amazonaws .serverless .proxy .spring .echoapp .model .SingleValueModel ;
1717import com .amazonaws .services .lambda .runtime .Context ;
18- import tools .jackson .core .JsonProcessingException ;
18+ import tools .jackson .core .JacksonException ;
1919import tools .jackson .databind .ObjectMapper ;
2020import org .apache .commons .codec .binary .Base64 ;
2121import org .junit .jupiter .api .BeforeEach ;
@@ -294,7 +294,7 @@ void error_unauthenticatedCall_filterStepsRequest(String reqType) {
294294
295295 @ MethodSource ("data" )
296296 @ ParameterizedTest
297- void responseBody_responseWriter_validBody (String reqType ) throws JsonProcessingException {
297+ void responseBody_responseWriter_validBody (String reqType ) throws JacksonException {
298298 initSpringAwsProxyTest (reqType );
299299 SingleValueModel singleValueModel = new SingleValueModel ();
300300 singleValueModel .setValue (CUSTOM_HEADER_VALUE );
@@ -311,7 +311,7 @@ void responseBody_responseWriter_validBody(String reqType) throws JsonProcessing
311311
312312 @ MethodSource ("data" )
313313 @ ParameterizedTest
314- void responseBody_responseWriter_validBody_UTF (String reqType ) throws JsonProcessingException {
314+ void responseBody_responseWriter_validBody_UTF (String reqType ) throws JacksonException {
315315 initSpringAwsProxyTest (reqType );
316316 SingleValueModel singleValueModel = new SingleValueModel ();
317317 singleValueModel .setValue (UNICODE_VALUE );
@@ -363,7 +363,7 @@ void injectBody_populatedResponse_noException(String reqType) {
363363 try {
364364 SingleValueModel output = objectMapper .readValue (response .getBody (), SingleValueModel .class );
365365 assertEquals ("true" , output .getValue ());
366- } catch (IOException e ) {
366+ } catch (JacksonException e ) {
367367 e .printStackTrace ();
368368 fail ();
369369 }
@@ -373,7 +373,7 @@ void injectBody_populatedResponse_noException(String reqType) {
373373 try {
374374 SingleValueModel output = objectMapper .readValue (emptyResp .getBody (), SingleValueModel .class );
375375 assertNull (output .getValue ());
376- } catch (IOException e ) {
376+ } catch (JacksonException e ) {
377377 e .printStackTrace ();
378378 fail ();
379379 }
@@ -392,7 +392,7 @@ void servletRequestEncoding_acceptEncoding_okStatusCode(String reqType) {
392392 .header (HttpHeaders .ACCEPT_ENCODING , "gzip, deflate" )
393393 .queryString ("status" , "200" )
394394 .body (objectMapper .writeValueAsString (singleValueModel ));
395- } catch (JsonProcessingException e ) {
395+ } catch (JacksonException e ) {
396396 fail ("Could not serialize object to JSON" );
397397 }
398398
@@ -484,7 +484,7 @@ private void validateMapResponseModel(AwsProxyResponse output) {
484484 MapResponseModel response = objectMapper .readValue (output .getBody (), MapResponseModel .class );
485485 assertNotNull (response .getValues ().get (CUSTOM_HEADER_KEY ));
486486 assertEquals (CUSTOM_HEADER_VALUE , response .getValues ().get (CUSTOM_HEADER_KEY ));
487- } catch (IOException e ) {
487+ } catch (JacksonException e ) {
488488 e .printStackTrace ();
489489 fail ("Exception while parsing response body: " + e .getMessage ());
490490 }
@@ -495,7 +495,7 @@ private void validateSingleValueModel(AwsProxyResponse output, String value) {
495495 SingleValueModel response = objectMapper .readValue (output .getBody (), SingleValueModel .class );
496496 assertNotNull (response .getValue ());
497497 assertEquals (value , response .getValue ());
498- } catch (IOException e ) {
498+ } catch (JacksonException e ) {
499499 e .printStackTrace ();
500500 fail ("Exception while parsing response body: " + e .getMessage ());
501501 }
0 commit comments