@Test public void validation_throwsException() { TestBuilder testBuilder = new TestBuilder(); try { testBuilder.validate(); } catch (ContainerInitializationException e) { return; } fail("Did not throw exception"); }
protected void validate() throws ContainerInitializationException { List<String> errFields = new ArrayList<>(); if (requestTypeClass == null) { errFields.add("request type class"); } if (responseTypeClass == null) { errFields.add("response type class"); } if (requestReader == null) { errFields.add("request reader"); } if (responseWriter == null) { errFields.add("response writer"); } if (securityContextWriter == null) { errFields.add("security context writer"); } if (exceptionHandler == null) { errFields.add("exception handler"); } if (initializationWrapper == null) { errFields.add("initialization wrapper"); } if (!errFields.isEmpty()) { throw new ContainerInitializationException(String.format(MISSING_FIELD_ERROR, String.join(", ", errFields)), null); } }
ServletLambdaContainerHandlerBuilder { protected void validate() throws ContainerInitializationException { List<String> errFields = new ArrayList<>(); if (requestTypeClass == null) { errFields.add("request type class"); } if (responseTypeClass == null) { errFields.add("response type class"); } if (requestReader == null) { errFields.add("request reader"); } if (responseWriter == null) { errFields.add("response writer"); } if (securityContextWriter == null) { errFields.add("security context writer"); } if (exceptionHandler == null) { errFields.add("exception handler"); } if (initializationWrapper == null) { errFields.add("initialization wrapper"); } if (!errFields.isEmpty()) { throw new ContainerInitializationException(String.format(MISSING_FIELD_ERROR, String.join(", ", errFields)), null); } } }
ServletLambdaContainerHandlerBuilder { protected void validate() throws ContainerInitializationException { List<String> errFields = new ArrayList<>(); if (requestTypeClass == null) { errFields.add("request type class"); } if (responseTypeClass == null) { errFields.add("response type class"); } if (requestReader == null) { errFields.add("request reader"); } if (responseWriter == null) { errFields.add("response writer"); } if (securityContextWriter == null) { errFields.add("security context writer"); } if (exceptionHandler == null) { errFields.add("exception handler"); } if (initializationWrapper == null) { errFields.add("initialization wrapper"); } if (!errFields.isEmpty()) { throw new ContainerInitializationException(String.format(MISSING_FIELD_ERROR, String.join(", ", errFields)), null); } }  }
ServletLambdaContainerHandlerBuilder { protected void validate() throws ContainerInitializationException { List<String> errFields = new ArrayList<>(); if (requestTypeClass == null) { errFields.add("request type class"); } if (responseTypeClass == null) { errFields.add("response type class"); } if (requestReader == null) { errFields.add("request reader"); } if (responseWriter == null) { errFields.add("response writer"); } if (securityContextWriter == null) { errFields.add("security context writer"); } if (exceptionHandler == null) { errFields.add("exception handler"); } if (initializationWrapper == null) { errFields.add("initialization wrapper"); } if (!errFields.isEmpty()) { throw new ContainerInitializationException(String.format(MISSING_FIELD_ERROR, String.join(", ", errFields)), null); } }  Builder defaultProxy(); Builder defaultHttpApiV2Proxy(); Builder initializationWrapper(InitializationWrapper initializationWrapper); Builder requestReader(RequestReader<RequestType, ContainerRequestType> requestReader); Builder responseWriter(ResponseWriter<AwsHttpServletResponse, ResponseType> responseWriter); Builder securityContextWriter(SecurityContextWriter<RequestType> securityContextWriter); Builder exceptionHandler(ExceptionHandler<ResponseType> exceptionHandler); Builder requestTypeClass(Class<RequestType> requestType); Builder responseTypeClass(Class<ResponseType> responseType); @Deprecated Builder asyncInit(long actualStartTime); Builder asyncInit(); abstract HandlerType build(); abstract HandlerType buildAndInitialize(); }
ServletLambdaContainerHandlerBuilder { protected void validate() throws ContainerInitializationException { List<String> errFields = new ArrayList<>(); if (requestTypeClass == null) { errFields.add("request type class"); } if (responseTypeClass == null) { errFields.add("response type class"); } if (requestReader == null) { errFields.add("request reader"); } if (responseWriter == null) { errFields.add("response writer"); } if (securityContextWriter == null) { errFields.add("security context writer"); } if (exceptionHandler == null) { errFields.add("exception handler"); } if (initializationWrapper == null) { errFields.add("initialization wrapper"); } if (!errFields.isEmpty()) { throw new ContainerInitializationException(String.format(MISSING_FIELD_ERROR, String.join(", ", errFields)), null); } }  Builder defaultProxy(); Builder defaultHttpApiV2Proxy(); Builder initializationWrapper(InitializationWrapper initializationWrapper); Builder requestReader(RequestReader<RequestType, ContainerRequestType> requestReader); Builder responseWriter(ResponseWriter<AwsHttpServletResponse, ResponseType> responseWriter); Builder securityContextWriter(SecurityContextWriter<RequestType> securityContextWriter); Builder exceptionHandler(ExceptionHandler<ResponseType> exceptionHandler); Builder requestTypeClass(Class<RequestType> requestType); Builder responseTypeClass(Class<ResponseType> responseType); @Deprecated Builder asyncInit(long actualStartTime); Builder asyncInit(); abstract HandlerType build(); abstract HandlerType buildAndInitialize();  }