@Test public void handleRequestWithMockContext() { LambdaInfoApiHandler lambdaInfoApiHandler = new LambdaInfoApiHandler(); Context context = mock(Context.class); when(context.getAwsRequestId()).thenReturn("mock aws request id"); assertThat(lambdaInfoApiHandler.handleRequest(null, context), notNullValue()); }
@Override public ApiGatewayResponse handleRequest(Map<String, Object> input, Context context) { BasicConfigurator.configure(); LOG.info("received: " + input); return new ApiGatewayResponse .ApiGatewayResponseBuilder<LambdaInfo>() .headers(headers()) .statusCode(SUCCESS_STATUS_CODE) .body(lambdaInfo(context)) .build(); }
LambdaInfoApiHandler implements RequestHandler<Map<String, Object>, ApiGatewayResponse> { @Override public ApiGatewayResponse handleRequest(Map<String, Object> input, Context context) { BasicConfigurator.configure(); LOG.info("received: " + input); return new ApiGatewayResponse .ApiGatewayResponseBuilder<LambdaInfo>() .headers(headers()) .statusCode(SUCCESS_STATUS_CODE) .body(lambdaInfo(context)) .build(); } }
LambdaInfoApiHandler implements RequestHandler<Map<String, Object>, ApiGatewayResponse> { @Override public ApiGatewayResponse handleRequest(Map<String, Object> input, Context context) { BasicConfigurator.configure(); LOG.info("received: " + input); return new ApiGatewayResponse .ApiGatewayResponseBuilder<LambdaInfo>() .headers(headers()) .statusCode(SUCCESS_STATUS_CODE) .body(lambdaInfo(context)) .build(); }  }
LambdaInfoApiHandler implements RequestHandler<Map<String, Object>, ApiGatewayResponse> { @Override public ApiGatewayResponse handleRequest(Map<String, Object> input, Context context) { BasicConfigurator.configure(); LOG.info("received: " + input); return new ApiGatewayResponse .ApiGatewayResponseBuilder<LambdaInfo>() .headers(headers()) .statusCode(SUCCESS_STATUS_CODE) .body(lambdaInfo(context)) .build(); }  @Override ApiGatewayResponse handleRequest(Map<String, Object> input, Context context); }
LambdaInfoApiHandler implements RequestHandler<Map<String, Object>, ApiGatewayResponse> { @Override public ApiGatewayResponse handleRequest(Map<String, Object> input, Context context) { BasicConfigurator.configure(); LOG.info("received: " + input); return new ApiGatewayResponse .ApiGatewayResponseBuilder<LambdaInfo>() .headers(headers()) .statusCode(SUCCESS_STATUS_CODE) .body(lambdaInfo(context)) .build(); }  @Override ApiGatewayResponse handleRequest(Map<String, Object> input, Context context);  }