diff --git a/CHANGELOG.md b/CHANGELOG.md index 32495c4..eebfa2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,16 @@ Proteus Changelog. ## Unreleased ### No issue +**Bump dependency versions. Update favicon.** + + +[4777bce4c516e99](https://github.com/noboomu/proteus/commit/4777bce4c516e99) Joshua Bauer *2021-04-02 18:19:35* + +**Update README.md** + + +[8915888e8190521](https://github.com/noboomu/proteus/commit/8915888e8190521) JL Bauer *2021-03-20 05:19:59* + **Rollback swagger ui version.** diff --git a/proteus-core/src/main/java/io/sinistral/proteus/ProteusApplication.java b/proteus-core/src/main/java/io/sinistral/proteus/ProteusApplication.java index f415887..bf71f75 100644 --- a/proteus-core/src/main/java/io/sinistral/proteus/ProteusApplication.java +++ b/proteus-core/src/main/java/io/sinistral/proteus/ProteusApplication.java @@ -312,20 +312,24 @@ public void buildServer() for (Class controllerClass : registeredControllers) { - handlerExecutor.execute(() -> { + handlerExecutor.submit(() -> { try { - //log.debug("Compiling {}...", controllerClass); + // log.debug("Generating {}...", controllerClass); HandlerGenerator generator = new HandlerGenerator("io.sinistral.proteus.controllers.handlers", controllerClass); injector.injectMembers(generator); - routerClasses.add(generator.compileClass()); + // log.debug("Compiling {}...", controllerClass); - //log.debug("Compiled {}", controllerClass); + Class> routerClass = generator.compileClass(); + + routerClasses.add(routerClass); + + // log.debug("Compiled {}", controllerClass); } catch (Exception e) { diff --git a/proteus-core/src/main/java/io/sinistral/proteus/server/handlers/HandlerGenerator.java b/proteus-core/src/main/java/io/sinistral/proteus/server/handlers/HandlerGenerator.java index 80c280e..c62de58 100644 --- a/proteus-core/src/main/java/io/sinistral/proteus/server/handlers/HandlerGenerator.java +++ b/proteus-core/src/main/java/io/sinistral/proteus/server/handlers/HandlerGenerator.java @@ -128,7 +128,7 @@ public HandlerGenerator(String packageName, Class controllerClass) * Compiles the generated source into a new {@link Class} * @return a new {@code Supplier} class */ - public Class> compileClass() + public Class> compileClass() throws Exception { try @@ -137,12 +137,14 @@ public Class> compileClass() log.debug("\n\nGenerated Class Source:\n\n{}", this.sourceString); - return new CachedCompiler(null, null).loadFromJava(packageName + "." + className, this.sourceString); + CachedCompiler cachedCompiler = new CachedCompiler(null, null); + + return cachedCompiler.loadFromJava(packageName + "." + className, this.sourceString); } catch (Exception e) { log.error("Failed to compile {}\nSource:\n{}", packageName + "." + className, this.sourceString, e); - return null; + throw e; } } @@ -711,9 +713,26 @@ else if (handler.equals(TypeHandler.FromStringType)) typeName = typeName.replace("$", "."); } - String pType = interfaceType != null ? interfaceType + "TypeReference" : typeName + ".class"; + if (t.equals(TypeHandler.OptionalModelType)) + { + ParameterizedType pType = (ParameterizedType) type; - methodBuilder.addStatement(t.statement, type, p.getName(), pType); + if (type instanceof ParameterizedType) + { + pType = (ParameterizedType) type; + type = pType.getActualTypeArguments()[0]; + } + + String pTypeName = type.getTypeName() + ".class"; + + methodBuilder.addStatement(t.statement, type.getTypeName(), p.getName(), io.sinistral.proteus.server.Extractors.Optional.class, pTypeName); + + } + else + { + String pType = interfaceType != null ? interfaceType + "TypeReference" : typeName + ".class"; + methodBuilder.addStatement(t.statement, type, p.getName(), pType); + } } else if (t.equals(TypeHandler.OptionalNamedModelType) || t.equals(TypeHandler.NamedModelType)) diff --git a/proteus-core/src/main/java/io/sinistral/proteus/server/handlers/TypeHandler.java b/proteus-core/src/main/java/io/sinistral/proteus/server/handlers/TypeHandler.java index 5f94ffc..6fadd2a 100644 --- a/proteus-core/src/main/java/io/sinistral/proteus/server/handlers/TypeHandler.java +++ b/proteus-core/src/main/java/io/sinistral/proteus/server/handlers/TypeHandler.java @@ -124,7 +124,7 @@ public enum TypeHandler { OptionalZonedDateTimeType("$T<$T> $L = $T.zonedDateTime(exchange,$S)", false, Optional.class, java.time.ZonedDateTime.class, StatementParameterType.LITERAL, io.sinistral.proteus.server.Extractors.Optional.class, StatementParameterType.STRING), OptionalOffsetDateTimeType("$T<$T> $L = $T.offsetDateTime(exchange,$S)", false, Optional.class, java.time.OffsetDateTime.class, StatementParameterType.LITERAL, io.sinistral.proteus.server.Extractors.Optional.class, StatementParameterType.STRING), - OptionalModelType("java.util.Optional<$L> $L = $T.model(exchange,$L)", false, StatementParameterType.LITERAL, StatementParameterType.LITERAL, io.sinistral.proteus.server.Extractors.Optional.class, StatementParameterType.LITERAL,StatementParameterType.STRING), + OptionalModelType("java.util.Optional<$L> $L = $T.model(exchange,$L)", false, StatementParameterType.LITERAL, StatementParameterType.LITERAL, io.sinistral.proteus.server.Extractors.Optional.class, StatementParameterType.LITERAL), OptionalNamedJsonNodeType("$T<$T> $L = $T.namedJsonNode(exchange,$s)", true, Optional.class, com.fasterxml.jackson.databind.JsonNode.class, StatementParameterType.LITERAL, io.sinistral.proteus.server.Extractors.Optional.class,StatementParameterType.STRING), OptionalNamedModelType("java.util.Optional<$L> $L = $T.namedModel(exchange,$L,$S)", false, StatementParameterType.LITERAL, StatementParameterType.LITERAL, io.sinistral.proteus.server.Extractors.Optional.class, StatementParameterType.LITERAL), @@ -588,6 +588,8 @@ public static TypeHandler forType(Type type, Boolean isBeanParam) } else { try { + + Class erasedType = (Class) HandlerGenerator.extractErasedType(type); if (HandlerGenerator.hasValueOfMethod(erasedType)) { @@ -595,7 +597,11 @@ public static TypeHandler forType(Type type, Boolean isBeanParam) } else if (HandlerGenerator.hasFromStringMethod(erasedType)) { return OptionalFromStringType; + } + if(isBeanParam) + { + return OptionalModelType; } } catch (Exception e) { diff --git a/proteus-core/src/test/java/io/sinistral/proteus/test/controllers/Tests.java b/proteus-core/src/test/java/io/sinistral/proteus/test/controllers/Tests.java index 230d8bf..08b4183 100644 --- a/proteus-core/src/test/java/io/sinistral/proteus/test/controllers/Tests.java +++ b/proteus-core/src/test/java/io/sinistral/proteus/test/controllers/Tests.java @@ -229,6 +229,15 @@ public ServerResponse responseInnerClassTest(ServerRequest request, @BeanP { return response(user).applicationJson(); } + + @POST + @Path("response/json/beanparam-optional") + @Produces(MediaType.APPLICATION_OCTET_STREAM) + @Consumes(MediaType.APPLICATION_JSON) + public ServerResponse responseInnerClassOptionalTest(ServerRequest request, @BeanParam Optional user ) throws Exception + { + return response(user.orElse(null)).applicationJson(); + } @GET @@ -1028,4 +1037,6 @@ public ServerResponse> multipartUploadMultipleFiles(ServerReq } + + } diff --git a/proteus-core/src/test/java/io/sinistral/proteus/test/server/StandardEndpointsTest.java b/proteus-core/src/test/java/io/sinistral/proteus/test/server/StandardEndpointsTest.java index c15a4cb..4a7a5ab 100644 --- a/proteus-core/src/test/java/io/sinistral/proteus/test/server/StandardEndpointsTest.java +++ b/proteus-core/src/test/java/io/sinistral/proteus/test/server/StandardEndpointsTest.java @@ -373,6 +373,18 @@ public void responseBeanParam() } + @Test + public void responseOptionalBeanParam() + { + + User model = new User(); + model.setId(101L); + + given().contentType(ContentType.JSON).accept(ContentType.JSON).body(model).when().post("v1/tests/response/json/beanparam-optional").then().statusCode(200).and().body(containsString("101")); + + } + + @Test public void responseFutureUser() { diff --git a/proteus-core/src/test/resources/TestsRouteSupplier.java b/proteus-core/src/test/resources/TestsRouteSupplier.java new file mode 100644 index 0000000..65751f2 --- /dev/null +++ b/proteus-core/src/test/resources/TestsRouteSupplier.java @@ -0,0 +1,1370 @@ +import static io.sinistral.proteus.server.Extractors.*; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.JsonNode; +import com.google.inject.Inject; +import com.google.inject.name.Named; +import io.sinistral.proteus.test.controllers.Tests; +import io.sinistral.proteus.test.models.User; +import io.sinistral.proteus.test.wrappers.TestClassWrapper; +import io.sinistral.proteus.test.wrappers.TestWrapper; +import io.undertow.server.HandlerWrapper; +import io.undertow.server.HttpHandler; +import io.undertow.server.RoutingHandler; +import java.lang.String; +import java.math.BigDecimal; +import java.sql.Timestamp; +import java.time.Instant; +import java.util.Map; +import java.util.function.Supplier; + +public class TestsRouteSupplier implements Supplier { + protected final Tests testsController; + + protected final Map registeredHandlerWrappers; + + protected final TestWrapper ioSinistralProteusTestWrappersTestWrapper_1; + + protected final TestClassWrapper ioSinistralProteusTestWrappersTestClassWrapper; + + @Inject + public TestsRouteSupplier(Tests testsController, + @Named("registeredHandlerWrappers") Map registeredHandlerWrappers, + TestWrapper ioSinistralProteusTestWrappersTestWrapper_1, + TestClassWrapper ioSinistralProteusTestWrappersTestClassWrapper) { + this.testsController = testsController; + this.registeredHandlerWrappers = registeredHandlerWrappers; + this.ioSinistralProteusTestWrappersTestWrapper_1 = ioSinistralProteusTestWrappersTestWrapper_1; + this.ioSinistralProteusTestWrappersTestClassWrapper = ioSinistralProteusTestWrappersTestClassWrapper; + } + + public RoutingHandler get() { + final RoutingHandler router = new RoutingHandler(); + final TypeReference> langLongMapTypeReference = new TypeReference>(){}; + final TypeReference> langLongListTypeReference = new TypeReference>(){}; + final TypeReference> langLongSetTypeReference = new TypeReference>(){}; + final TypeReference sqlTimestampTypeReference = new TypeReference(){}; + final TypeReference databindJsonNodeTypeReference = new TypeReference(){}; + final TypeReference timeInstantTypeReference = new TypeReference(){}; + final TypeReference modelsUserTypeReference = new TypeReference(){}; + final TypeReference mathBigDecimalTypeReference = new TypeReference(){}; + HttpHandler currentHandler = null; + + final io.undertow.server.HttpHandler testsExchangeUserJsonHandler_1 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + + testsController.exchangeUserJson(exchange); + } + }; + + currentHandler = testsExchangeUserJsonHandler_1; + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/exchange/user/json",currentHandler); + + final io.undertow.server.HttpHandler testsGenericSetHandler_2 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + java.util.Set ids = exchange.getQueryParameters().get("ids").stream().map(java.lang.Long::valueOf).collect(java.util.stream.Collectors.toSet()); + + io.sinistral.proteus.server.ServerResponse> response = testsController.genericSet(request,ids); + response.send(exchange); + } + }; + + currentHandler = testsGenericSetHandler_2; + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/generic/set",currentHandler); + + final io.undertow.server.HttpHandler testsGenericBeanSetHandler_3 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + java.util.Set ids = io.sinistral.proteus.server.Extractors.model(exchange,langLongSetTypeReference); + + io.sinistral.proteus.server.ServerResponse> response = testsController.genericBeanSet(request,ids); + response.send(exchange); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsGenericBeanSetHandler_3); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.POST,"/v1/tests/generic/set/bean",currentHandler); + + final io.undertow.server.HttpHandler testsGenericBeanListHandler_4 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + java.util.List ids = io.sinistral.proteus.server.Extractors.model(exchange,langLongListTypeReference); + + io.sinistral.proteus.server.ServerResponse> response = testsController.genericBeanList(request,ids); + response.send(exchange); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsGenericBeanListHandler_4); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.POST,"/v1/tests/generic/list/bean",currentHandler); + + final io.undertow.server.HttpHandler testsGenericBeanMapHandler_5 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + java.util.Map ids = io.sinistral.proteus.server.Extractors.model(exchange,langLongMapTypeReference); + + io.sinistral.proteus.server.ServerResponse> response = testsController.genericBeanMap(request,ids); + response.send(exchange); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsGenericBeanMapHandler_5); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.POST,"/v1/tests/generic/map/bean",currentHandler); + + final io.undertow.server.HttpHandler testsExchangeUserXmlHandler_6 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + + testsController.exchangeUserXml(exchange); + } + }; + + currentHandler = testsExchangeUserXmlHandler_6; + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/exchange/user/xml",currentHandler); + + final io.undertow.server.HttpHandler testsResponseUserJsonHandler_7 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + + io.sinistral.proteus.server.ServerResponse response = testsController.responseUserJson(request); + response.send(exchange); + } + }; + + currentHandler = testsResponseUserJsonHandler_7; + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/response/user/json",currentHandler); + + final io.undertow.server.HttpHandler testsResponseUserXmlHandler_8 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + + io.sinistral.proteus.server.ServerResponse response = testsController.responseUserXml(request); + response.send(exchange); + } + }; + + currentHandler = testsResponseUserXmlHandler_8; + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/response/user/xml",currentHandler); + + final io.undertow.server.HttpHandler testsBadRequestHandler_9 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + + io.sinistral.proteus.server.ServerResponse> response = testsController.badRequest(request); + response.send(exchange); + } + }; + + currentHandler = testsBadRequestHandler_9; + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/response/badrequest",currentHandler); + + final io.undertow.server.HttpHandler testsBadRequestBlockingHandler_10 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + + io.sinistral.proteus.server.ServerResponse> response = testsController.badRequestBlocking(request); + response.send(exchange); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsBadRequestBlockingHandler_10); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/response/badrequest/blocking",currentHandler); + + final io.undertow.server.HttpHandler testsExchangePlaintextHandler_11 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + + testsController.exchangePlaintext(exchange); + } + }; + + currentHandler = testsExchangePlaintextHandler_11; + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/exchange/plaintext",currentHandler); + + final io.undertow.server.HttpHandler testsExchangePlaintext2Handler_12 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + + testsController.exchangePlaintext2(exchange); + } + }; + + currentHandler = testsExchangePlaintext2Handler_12; + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/exchange/plaintext2",currentHandler); + + final io.undertow.server.HttpHandler testsResponsePlaintextHandler_13 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + + io.sinistral.proteus.server.ServerResponse response = testsController.responsePlaintext(request); + response.send(exchange); + } + }; + + currentHandler = testsResponsePlaintextHandler_13; + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/response/plaintext",currentHandler); + + final io.undertow.server.HttpHandler testsResponseFutureUserHandler_14 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + + java.util.concurrent.CompletableFuture>> response = testsController.responseFutureUser(request); + exchange.dispatch( exchange.getConnection().getWorker(), () -> { + response.whenComplete( (r,ex) -> { + if(ex != null) { + exchange.putAttachment(io.undertow.server.handlers.ExceptionHandler.THROWABLE, ex); exchange.setResponseCode(500); + exchange.endExchange(); + } else { + r.send(exchange);} + } ); + } ); + } + }; + + currentHandler = testsResponseFutureUserHandler_14; + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/response/future/worker",currentHandler); + + final io.undertow.server.HttpHandler testsResponseFutureUserHandler_15 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + + java.util.concurrent.CompletableFuture response = testsController.responseFutureUser(); + exchange.dispatch( exchange.getConnection().getWorker(), () -> { + response.whenComplete( (r,ex) -> { + if(ex != null) { + exchange.putAttachment(io.undertow.server.handlers.ExceptionHandler.THROWABLE, ex); + exchange.setResponseCode(500); + exchange.endExchange(); + } else { + io.sinistral.proteus.server.ServerResponse.response(r).applicationJson().send(exchange);} + } ); + } ); + } + }; + + currentHandler = testsResponseFutureUserHandler_15; + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/response/future/user",currentHandler); + + final io.undertow.server.HttpHandler testsResponseFutureMapHandler_16 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + + java.util.concurrent.CompletableFuture> response = testsController.responseFutureMap(request); + exchange.dispatch( exchange.getConnection().getWorker(), () -> { + response.whenComplete( (r,ex) -> { + if(ex != null) { + exchange.putAttachment(io.undertow.server.handlers.ExceptionHandler.THROWABLE, ex); + exchange.setResponseCode(500); + exchange.endExchange(); + } else { + io.sinistral.proteus.server.ServerResponse.response(r).applicationJson().send(exchange);} + } ); + } ); + } + }; + + currentHandler = testsResponseFutureMapHandler_16; + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/response/future/map",currentHandler); + + final io.undertow.server.HttpHandler testsResponseFutureResponseMapHandler_17 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + + java.util.concurrent.CompletableFuture>> response = testsController.responseFutureResponseMap(request); + exchange.dispatch( exchange.getConnection().getWorker(), () -> { + response.whenComplete( (r,ex) -> { + if(ex != null) { + exchange.putAttachment(io.undertow.server.handlers.ExceptionHandler.THROWABLE, ex); exchange.setResponseCode(500); + exchange.endExchange(); + } else { + r.send(exchange);} + } ); + } ); + } + }; + + currentHandler = testsResponseFutureResponseMapHandler_17; + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/response/future/response",currentHandler); + + final io.undertow.server.HttpHandler testsTestRedirectHandler_18 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + + io.sinistral.proteus.server.ServerResponse response = testsController.testRedirect(); + response.send(exchange); + } + }; + + currentHandler = testsTestRedirectHandler_18; + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/redirect",currentHandler); + + final io.undertow.server.HttpHandler testsMaxValueHandler_19 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + Integer param = io.sinistral.proteus.server.Extractors.integerValue(exchange,"param"); + if( param > 100 ) { + throw new io.sinistral.proteus.server.exceptions.ServerException("must be less than or equal to 100",javax.ws.rs.core.Response.Status.BAD_REQUEST); + } + + io.sinistral.proteus.server.ServerResponse response = testsController.maxValue(request,param); + response.send(exchange); + } + }; + + currentHandler = testsMaxValueHandler_19; + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/response/max",currentHandler); + + final io.undertow.server.HttpHandler testsMinValueHandler_20 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + Integer param = io.sinistral.proteus.server.Extractors.integerValue(exchange,"param"); + if( param < 10 ) { + throw new io.sinistral.proteus.server.exceptions.ServerException("must be greater than or equal to 10",javax.ws.rs.core.Response.Status.BAD_REQUEST); + } + + io.sinistral.proteus.server.ServerResponse response = testsController.minValue(request,param); + response.send(exchange); + } + }; + + currentHandler = testsMinValueHandler_20; + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/response/min",currentHandler); + + final io.undertow.server.HttpHandler testsUploadMultipleFileListHandler_21 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + java.util.List files = io.sinistral.proteus.server.Extractors.fileList(exchange,"files"); + java.util.List names = exchange.getQueryParameters().get("names").stream().map(java.lang.String::valueOf).collect(java.util.stream.Collectors.toList()); + + io.sinistral.proteus.server.ServerResponse> response = testsController.uploadMultipleFileList(request,files,names); + response.send(exchange); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsUploadMultipleFileListHandler_21); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.POST,"/v1/tests/list/file",currentHandler); + + final io.undertow.server.HttpHandler testsUploadMultiplePathListHandler_22 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + java.util.List files = io.sinistral.proteus.server.Extractors.pathList(exchange,"files"); + java.util.List names = exchange.getQueryParameters().get("names").stream().map(java.lang.String::valueOf).collect(java.util.stream.Collectors.toList()); + + io.sinistral.proteus.server.ServerResponse> response = testsController.uploadMultiplePathList(request,files,names); + response.send(exchange); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsUploadMultiplePathListHandler_22); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.POST,"/v1/tests/list/path",currentHandler); + + final io.undertow.server.HttpHandler testsUploadMultipleFileMapHandler_23 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + java.util.Map files = io.sinistral.proteus.server.Extractors.fileMap(exchange,"files"); + + io.sinistral.proteus.server.ServerResponse> response = testsController.uploadMultipleFileMap(request,files); + response.send(exchange); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsUploadMultipleFileMapHandler_23); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.POST,"/v1/tests/map/file",currentHandler); + + final io.undertow.server.HttpHandler testsUploadMultiplePathMapHandler_24 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + java.util.Map files = io.sinistral.proteus.server.Extractors.pathMap(exchange,"files"); + + io.sinistral.proteus.server.ServerResponse> response = testsController.uploadMultiplePathMap(request,files); + response.send(exchange); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsUploadMultiplePathMapHandler_24); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.POST,"/v1/tests/map/path",currentHandler); + + final io.undertow.server.HttpHandler testsExchangeJsonSerializeHandler_25 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + + testsController.exchangeJsonSerialize(exchange); + } + }; + + currentHandler = testsExchangeJsonSerializeHandler_25; + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/exchange/json/serialize",currentHandler); + + final io.undertow.server.HttpHandler testsExchangeJsonSerializeToBytesHandler_26 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + + testsController.exchangeJsonSerializeToBytes(exchange); + } + }; + + currentHandler = testsExchangeJsonSerializeToBytesHandler_26; + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/exchange/json/serializeToBytes",currentHandler); + + final io.undertow.server.HttpHandler testsFutureMapHandler_27 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + + io.sinistral.proteus.server.ServerResponse> response = testsController.futureMap(request); + response.send(exchange); + } + }; + + currentHandler = testsFutureMapHandler_27; + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/response/map",currentHandler); + + final io.undertow.server.HttpHandler testsResponseUploadFilePathHandler_28 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + java.nio.file.Path file = io.sinistral.proteus.server.Extractors.filePath(exchange,"file"); + + io.sinistral.proteus.server.ServerResponse response = testsController.responseUploadFilePath(request,file); + response.send(exchange); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsResponseUploadFilePathHandler_28); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.POST,"/v1/tests/response/file/path",currentHandler); + + final io.undertow.server.HttpHandler testsResponseUploadOptionalFilePathHandler_29 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + java.util.Optional file = io.sinistral.proteus.server.Extractors.Optional.filePath(exchange,"file"); + + io.sinistral.proteus.server.ServerResponse response = testsController.responseUploadOptionalFilePath(request,file); + response.send(exchange); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsResponseUploadOptionalFilePathHandler_29); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.POST,"/v1/tests/response/file/path/optional",currentHandler); + + final io.undertow.server.HttpHandler testsResponseEchoJsonHandler_30 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + io.sinistral.proteus.test.models.User user = io.sinistral.proteus.server.Extractors.namedModel(exchange,io.sinistral.proteus.test.models.User.class,"user"); + + io.sinistral.proteus.server.ServerResponse response = testsController.responseEchoJson(request,user); + response.send(exchange); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsResponseEchoJsonHandler_30); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.POST,"/v1/tests/response/json/echo",currentHandler); + + final io.undertow.server.HttpHandler testsResponseInnerClassTestHandler_31 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + io.sinistral.proteus.test.models.User user = io.sinistral.proteus.server.Extractors.model(exchange,io.sinistral.proteus.test.models.User.class); + + io.sinistral.proteus.server.ServerResponse response = testsController.responseInnerClassTest(request,user); + response.send(exchange); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsResponseInnerClassTestHandler_31); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.POST,"/v1/tests/response/json/beanparam",currentHandler); + + final io.undertow.server.HttpHandler testsGenericOptionalSetHandler_32 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + java.util.Optional> ids = java.util.Optional.ofNullable(exchange.getQueryParameters().get("ids")).map(java.util.Deque::stream).map( p -> p.map(java.lang.Long::valueOf).collect(java.util.stream.Collectors.toSet())); + + io.sinistral.proteus.server.ServerResponse> response = testsController.genericOptionalSet(request,ids); + response.send(exchange); + } + }; + + currentHandler = testsGenericOptionalSetHandler_32; + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/optional/set",currentHandler); + + final io.undertow.server.HttpHandler testsTestPermanentRedirectHandler_33 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + + io.sinistral.proteus.server.ServerResponse response = testsController.testPermanentRedirect(); + response.send(exchange); + } + }; + + currentHandler = testsTestPermanentRedirectHandler_33; + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/redirect/permanent",currentHandler); + + final io.undertow.server.HttpHandler testsListConversionHandler_34 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + java.util.List ids = io.sinistral.proteus.server.Extractors.model(exchange,langLongListTypeReference); + + io.sinistral.proteus.server.ServerResponse> response = testsController.listConversion(request,ids); + response.send(exchange); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsListConversionHandler_34); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.POST,"/v1/tests/response/parse/ids",currentHandler); + + final io.undertow.server.HttpHandler testsTimestampConversionHandler_35 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + java.sql.Timestamp timestamp = java.sql.Timestamp.valueOf(io.sinistral.proteus.server.Extractors.string(exchange,"timestamp")); + + io.sinistral.proteus.server.ServerResponse response = testsController.timestampConversion(request,timestamp); + response.send(exchange); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsTimestampConversionHandler_35); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/response/parse/timestamp",currentHandler); + + final io.undertow.server.HttpHandler testsDoubleConversionHandler_36 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + Double value = io.sinistral.proteus.server.Extractors.doubleValue(exchange,"value"); + + io.sinistral.proteus.server.ServerResponse response = testsController.doubleConversion(request,value); + response.send(exchange); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsDoubleConversionHandler_36); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/response/parse/double",currentHandler); + + final io.undertow.server.HttpHandler testsBigDecimalConversionHandler_37 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + BigDecimal value = io.sinistral.proteus.server.Extractors.bigDecimalValue(exchange,"value"); + + io.sinistral.proteus.server.ServerResponse response = testsController.bigDecimalConversion(request,value); + response.send(exchange); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsBigDecimalConversionHandler_37); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/response/parse/big-decimal",currentHandler); + + final io.undertow.server.HttpHandler testsInstantConversionHandler_38 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + java.time.Instant instant = io.sinistral.proteus.server.Extractors.instant(exchange,"instant"); + + io.sinistral.proteus.server.ServerResponse response = testsController.instantConversion(request,instant); + response.send(exchange); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsInstantConversionHandler_38); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/response/parse/instant",currentHandler); + + final io.undertow.server.HttpHandler testsResponseUploadByteBufferHandler_39 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + java.nio.ByteBuffer file = io.sinistral.proteus.server.Extractors.namedByteBuffer(exchange,"file"); + + io.sinistral.proteus.server.ServerResponse response = testsController.responseUploadByteBuffer(request,file); + response.send(exchange); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsResponseUploadByteBufferHandler_39); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.POST,"/v1/tests/response/bytebuffer",currentHandler); + + final io.undertow.server.HttpHandler testsResponseUploadFileHandler_40 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + java.io.File file = io.sinistral.proteus.server.Extractors.file(exchange,"file"); + + io.sinistral.proteus.server.ServerResponse response = testsController.responseUploadFile(request,file); + response.send(exchange); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsResponseUploadFileHandler_40); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.POST,"/v1/tests/response/file",currentHandler); + + final io.undertow.server.HttpHandler testsPathParamEndpointHandler_41 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + String param = io.sinistral.proteus.server.Extractors.string(exchange,"param"); + + io.sinistral.proteus.server.ServerResponse response = testsController.pathParamEndpoint(request,param); + response.send(exchange); + } + }; + + currentHandler = testsPathParamEndpointHandler_41; + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/response/params/path/{param}",currentHandler); + + final io.undertow.server.HttpHandler testsDebugEndpointHandler_42 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + + io.sinistral.proteus.server.ServerResponse> response = testsController.debugEndpoint(request); + response.send(exchange); + } + }; + + currentHandler = testsDebugEndpointHandler_42; + currentHandler = ioSinistralProteusTestWrappersTestWrapper_1.wrap(currentHandler); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/response/debug",currentHandler); + + final io.undertow.server.HttpHandler testsNotFoundErrorHandler_43 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + java.util.Optional param = io.sinistral.proteus.server.Extractors.Optional.string(exchange,"test"); + + io.sinistral.proteus.server.ServerResponse response = testsController.notFoundError(request,param); + response.send(exchange); + } + }; + + currentHandler = testsNotFoundErrorHandler_43; + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/response/error/404",currentHandler); + + final io.undertow.server.HttpHandler testsUnauthorizedErrorHandler_44 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + java.util.Optional param = io.sinistral.proteus.server.Extractors.Optional.string(exchange,"test"); + + io.sinistral.proteus.server.ServerResponse response = testsController.unauthorizedError(request,param); + response.send(exchange); + } + }; + + currentHandler = testsUnauthorizedErrorHandler_44; + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/response/error/401",currentHandler); + + final io.undertow.server.HttpHandler testsDebugBlockingEndpointHandler_45 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + + io.sinistral.proteus.server.ServerResponse> response = testsController.debugBlockingEndpoint(request); + response.send(exchange); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsDebugBlockingEndpointHandler_45); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/response/debug/blocking",currentHandler); + + final io.undertow.server.HttpHandler testsResponseFutureBadRequestHandler_46 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + + java.util.concurrent.CompletableFuture>> response = testsController.responseFutureBadRequest(request); + exchange.dispatch( exchange.getConnection().getWorker(), () -> { + response.whenComplete( (r,ex) -> { + if(ex != null) { + exchange.putAttachment(io.undertow.server.handlers.ExceptionHandler.THROWABLE, ex); exchange.setResponseCode(500); + exchange.endExchange(); + } else { + r.send(exchange);} + } ); + } ); + } + }; + + currentHandler = testsResponseFutureBadRequestHandler_46; + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/future/badrequest",currentHandler); + + final io.undertow.server.HttpHandler testsResponseFutureBadRequestBlockingHandler_47 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + + java.util.concurrent.CompletableFuture>> response = testsController.responseFutureBadRequestBlocking(request); + exchange.dispatch( exchange.getConnection().getWorker(), () -> { + response.whenComplete( (r,ex) -> { + if(ex != null) { + exchange.putAttachment(io.undertow.server.handlers.ExceptionHandler.THROWABLE, ex); exchange.setResponseCode(500); + exchange.endExchange(); + } else { + r.send(exchange);} + } ); + } ); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsResponseFutureBadRequestBlockingHandler_47); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/future/badrequest/blocking",currentHandler); + + final io.undertow.server.HttpHandler testsResponseFutureNotFoundBlockingHandler_48 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + + java.util.concurrent.CompletableFuture>> response = testsController.responseFutureNotFoundBlocking(request); + exchange.dispatch( exchange.getConnection().getWorker(), () -> { + response.whenComplete( (r,ex) -> { + if(ex != null) { + exchange.putAttachment(io.undertow.server.handlers.ExceptionHandler.THROWABLE, ex); exchange.setResponseCode(500); + exchange.endExchange(); + } else { + r.send(exchange);} + } ); + } ); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsResponseFutureNotFoundBlockingHandler_48); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/future/notfound/blocking",currentHandler); + + final io.undertow.server.HttpHandler testsResponseFutureUserBlockingHandler_49 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + + java.util.concurrent.CompletableFuture>> response = testsController.responseFutureUserBlocking(request); + exchange.dispatch( exchange.getConnection().getWorker(), () -> { + response.whenComplete( (r,ex) -> { + if(ex != null) { + exchange.putAttachment(io.undertow.server.handlers.ExceptionHandler.THROWABLE, ex); exchange.setResponseCode(500); + exchange.endExchange(); + } else { + r.send(exchange);} + } ); + } ); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsResponseFutureUserBlockingHandler_49); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/response/future/worker/blocking",currentHandler); + + final io.undertow.server.HttpHandler testsComplexParametersHandler_50 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + io.sinistral.proteus.server.ServerRequest serverRequest = new io.sinistral.proteus.server.ServerRequest(exchange); + Long pathLong = io.sinistral.proteus.server.Extractors.longValue(exchange,"pathLong"); + java.util.Optional optionalQueryString = io.sinistral.proteus.server.Extractors.Optional.string(exchange,"optionalQueryString"); + java.util.Optional optionalQueryLong = io.sinistral.proteus.server.Extractors.Optional.longValue(exchange,"optionalQueryLong"); + java.util.Optional optionalQueryDate = io.sinistral.proteus.server.Extractors.Optional.offsetDateTime(exchange,"optionalQueryDate"); + java.util.Optional optionalQueryUUID = io.sinistral.proteus.server.Extractors.Optional.string(exchange,"optionalQueryUUID").map(java.util.UUID::fromString); + java.util.Optional optionalHeaderUUID = io.sinistral.proteus.server.Extractors.Header.Optional.string(exchange,"optionalHeaderUUID").map(java.util.UUID::fromString); + java.util.Optional optionalQueryEnum = io.sinistral.proteus.server.Extractors.Optional.string(exchange,"optionalQueryEnum").map(io.sinistral.proteus.test.models.User.UserType::valueOf); + java.util.Optional optionalHeaderString = io.sinistral.proteus.server.Extractors.Header.Optional.string(exchange,"optionalHeaderString"); + java.util.UUID queryUUID = java.util.UUID.fromString(io.sinistral.proteus.server.Extractors.string(exchange,"queryUUID")); + java.lang.String headerString = io.sinistral.proteus.server.Extractors.Header.string(exchange,"headerString"); + io.sinistral.proteus.test.models.User.UserType queryEnum = io.sinistral.proteus.test.models.User.UserType.valueOf(io.sinistral.proteus.server.Extractors.string(exchange,"queryEnum")); + java.util.List queryIntegerList = exchange.getQueryParameters().get("queryIntegerList").stream().map(java.lang.Integer::valueOf).collect(java.util.stream.Collectors.toList()); + Long queryLong = io.sinistral.proteus.server.Extractors.longValue(exchange,"queryLong"); + + io.sinistral.proteus.server.ServerResponse> response = testsController.complexParameters(serverRequest,pathLong,optionalQueryString,optionalQueryLong,optionalQueryDate,optionalQueryUUID,optionalHeaderUUID,optionalQueryEnum,optionalHeaderString,queryUUID,headerString,queryEnum,queryIntegerList,queryLong); + response.send(exchange); + } + }; + + currentHandler = testsComplexParametersHandler_50; + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/response/parameters/complex/{pathLong}",currentHandler); + + final io.undertow.server.HttpHandler testsResponseSecureContextHandler_51 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + + io.sinistral.proteus.server.ServerResponse> response = testsController.responseSecureContext(); + response.send(exchange); + } + }; + + currentHandler = testsResponseSecureContextHandler_51; + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.GET,"/v1/tests/secure/resource",currentHandler); + + final io.undertow.server.HttpHandler testsMultipartUploadByteBufferHandler_52 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + java.nio.ByteBuffer buffer = io.sinistral.proteus.server.Extractors.namedByteBuffer(exchange,"buffer"); + + io.sinistral.proteus.server.ServerResponse> response = testsController.multipartUploadByteBuffer(request,buffer); + response.send(exchange); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestDumpingHandler(new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsMultipartUploadByteBufferHandler_52)); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.POST,"/v1/tests/multipart/bytebuffer",currentHandler); + + final io.undertow.server.HttpHandler testsMultipartFutureUploadByteBufferHandler_53 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + java.nio.ByteBuffer buffer = io.sinistral.proteus.server.Extractors.namedByteBuffer(exchange,"buffer"); + + java.util.concurrent.CompletableFuture>> response = testsController.multipartFutureUploadByteBuffer(request,buffer); + exchange.dispatch( exchange.getConnection().getWorker(), () -> { + response.whenComplete( (r,ex) -> { + if(ex != null) { + exchange.putAttachment(io.undertow.server.handlers.ExceptionHandler.THROWABLE, ex); exchange.setResponseCode(500); + exchange.endExchange(); + } else { + r.send(exchange);} + } ); + } ); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsMultipartFutureUploadByteBufferHandler_53); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.POST,"/v1/tests/multipart/future/bytebuffer",currentHandler); + + final io.undertow.server.HttpHandler testsMultipartUploadMixedHandler_54 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + java.nio.ByteBuffer buffer = io.sinistral.proteus.server.Extractors.namedByteBuffer(exchange,"buffer"); + io.sinistral.proteus.test.models.User user = io.sinistral.proteus.server.Extractors.namedModel(exchange,io.sinistral.proteus.test.models.User.class,"user"); + Integer userId = io.sinistral.proteus.server.Extractors.integerValue(exchange,"userId"); + + io.sinistral.proteus.server.ServerResponse> response = testsController.multipartUploadMixed(request,buffer,user,userId); + response.send(exchange); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestDumpingHandler(new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsMultipartUploadMixedHandler_54)); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.POST,"/v1/tests/multipart/mixed",currentHandler); + + final io.undertow.server.HttpHandler testsMultipartUploadFutureMixedHandler_55 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + java.nio.ByteBuffer buffer = io.sinistral.proteus.server.Extractors.namedByteBuffer(exchange,"buffer"); + io.sinistral.proteus.test.models.User user = io.sinistral.proteus.server.Extractors.namedModel(exchange,io.sinistral.proteus.test.models.User.class,"user"); + Integer userId = io.sinistral.proteus.server.Extractors.integerValue(exchange,"userId"); + + java.util.concurrent.CompletableFuture>> response = testsController.multipartUploadFutureMixed(request,buffer,user,userId); + exchange.dispatch( exchange.getConnection().getWorker(), () -> { + response.whenComplete( (r,ex) -> { + if(ex != null) { + exchange.putAttachment(io.undertow.server.handlers.ExceptionHandler.THROWABLE, ex); exchange.setResponseCode(500); + exchange.endExchange(); + } else { + r.send(exchange);} + } ); + } ); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestDumpingHandler(new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsMultipartUploadFutureMixedHandler_55)); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.POST,"/v1/tests/multipart/future/mixed",currentHandler); + + final io.undertow.server.HttpHandler testsMultipartUploadJsonHandler_56 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + com.fasterxml.jackson.databind.JsonNode node = io.sinistral.proteus.server.Extractors.namedJsonNode(exchange,"json"); + + io.sinistral.proteus.server.ServerResponse response = testsController.multipartUploadJson(request,node); + response.send(exchange); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsMultipartUploadJsonHandler_56); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.POST,"/v1/tests/multipart/json",currentHandler); + + final io.undertow.server.HttpHandler testsMultipartUploadFutureJsonHandler_57 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + com.fasterxml.jackson.databind.JsonNode json = io.sinistral.proteus.server.Extractors.namedJsonNode(exchange,"json"); + + java.util.concurrent.CompletableFuture> response = testsController.multipartUploadFutureJson(request,json); + exchange.dispatch( exchange.getConnection().getWorker(), () -> { + response.whenComplete( (r,ex) -> { + if(ex != null) { + exchange.putAttachment(io.undertow.server.handlers.ExceptionHandler.THROWABLE, ex); exchange.setResponseCode(500); + exchange.endExchange(); + } else { + r.send(exchange);} + } ); + } ); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsMultipartUploadFutureJsonHandler_57); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.POST,"/v1/tests/multipart/future/json",currentHandler); + + final io.undertow.server.HttpHandler testsMultipartUploadMixedWithPathHandler_58 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + java.nio.file.Path path = io.sinistral.proteus.server.Extractors.filePath(exchange,"path"); + io.sinistral.proteus.test.models.User user = io.sinistral.proteus.server.Extractors.namedModel(exchange,io.sinistral.proteus.test.models.User.class,"user"); + Integer userId = io.sinistral.proteus.server.Extractors.integerValue(exchange,"userId"); + + io.sinistral.proteus.server.ServerResponse> response = testsController.multipartUploadMixedWithPath(request,path,user,userId); + response.send(exchange); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsMultipartUploadMixedWithPathHandler_58); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.POST,"/v1/tests/multipart/path-mixed",currentHandler); + + final io.undertow.server.HttpHandler testsMultipartUploadFutureMixedWithPathHandler_59 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + java.nio.file.Path path = io.sinistral.proteus.server.Extractors.filePath(exchange,"path"); + io.sinistral.proteus.test.models.User user = io.sinistral.proteus.server.Extractors.namedModel(exchange,io.sinistral.proteus.test.models.User.class,"user"); + Integer userId = io.sinistral.proteus.server.Extractors.integerValue(exchange,"userId"); + + java.util.concurrent.CompletableFuture>> response = testsController.multipartUploadFutureMixedWithPath(request,path,user,userId); + exchange.dispatch( exchange.getConnection().getWorker(), () -> { + response.whenComplete( (r,ex) -> { + if(ex != null) { + exchange.putAttachment(io.undertow.server.handlers.ExceptionHandler.THROWABLE, ex); exchange.setResponseCode(500); + exchange.endExchange(); + } else { + r.send(exchange);} + } ); + } ); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsMultipartUploadFutureMixedWithPathHandler_59); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.POST,"/v1/tests/multipart/future/path-mixed",currentHandler); + + final io.undertow.server.HttpHandler testsMultipartUploadMixedWithFileHandler_60 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + java.io.File file = io.sinistral.proteus.server.Extractors.file(exchange,"file"); + io.sinistral.proteus.test.models.User user = io.sinistral.proteus.server.Extractors.namedModel(exchange,io.sinistral.proteus.test.models.User.class,"user"); + Integer userId = io.sinistral.proteus.server.Extractors.integerValue(exchange,"userId"); + + io.sinistral.proteus.server.ServerResponse> response = testsController.multipartUploadMixedWithFile(request,file,user,userId); + response.send(exchange); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsMultipartUploadMixedWithFileHandler_60); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.POST,"/v1/tests/multipart/file-mixed",currentHandler); + + final io.undertow.server.HttpHandler testsMultipartUploadFutureMixedWithFileHandler_61 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + java.io.File file = io.sinistral.proteus.server.Extractors.file(exchange,"file"); + io.sinistral.proteus.test.models.User user = io.sinistral.proteus.server.Extractors.namedModel(exchange,io.sinistral.proteus.test.models.User.class,"user"); + Integer userId = io.sinistral.proteus.server.Extractors.integerValue(exchange,"userId"); + + java.util.concurrent.CompletableFuture>> response = testsController.multipartUploadFutureMixedWithFile(request,file,user,userId); + exchange.dispatch( exchange.getConnection().getWorker(), () -> { + response.whenComplete( (r,ex) -> { + if(ex != null) { + exchange.putAttachment(io.undertow.server.handlers.ExceptionHandler.THROWABLE, ex); exchange.setResponseCode(500); + exchange.endExchange(); + } else { + r.send(exchange);} + } ); + } ); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsMultipartUploadFutureMixedWithFileHandler_61); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.POST,"/v1/tests/multipart/future/file-mixed",currentHandler); + + final io.undertow.server.HttpHandler testsMultipartUploadMultipleBuffersHandler_62 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + java.nio.ByteBuffer file1 = io.sinistral.proteus.server.Extractors.namedByteBuffer(exchange,"file1"); + java.nio.ByteBuffer file2 = io.sinistral.proteus.server.Extractors.namedByteBuffer(exchange,"file2"); + java.nio.ByteBuffer file3 = io.sinistral.proteus.server.Extractors.namedByteBuffer(exchange,"file3"); + io.sinistral.proteus.test.models.User user = io.sinistral.proteus.server.Extractors.namedModel(exchange,io.sinistral.proteus.test.models.User.class,"user"); + Integer userId = io.sinistral.proteus.server.Extractors.integerValue(exchange,"userId"); + + io.sinistral.proteus.server.ServerResponse> response = testsController.multipartUploadMultipleBuffers(request,file1,file2,file3,user,userId); + response.send(exchange); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsMultipartUploadMultipleBuffersHandler_62); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.POST,"/v1/tests/multipart/multiple-buffers",currentHandler); + + final io.undertow.server.HttpHandler testsMultipartUploadMultipleFilesHandler_63 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + java.io.File file1 = io.sinistral.proteus.server.Extractors.file(exchange,"file1"); + java.io.File file2 = io.sinistral.proteus.server.Extractors.file(exchange,"file2"); + java.io.File file3 = io.sinistral.proteus.server.Extractors.file(exchange,"file3"); + io.sinistral.proteus.test.models.User user = io.sinistral.proteus.server.Extractors.namedModel(exchange,io.sinistral.proteus.test.models.User.class,"user"); + Integer userId = io.sinistral.proteus.server.Extractors.integerValue(exchange,"userId"); + + io.sinistral.proteus.server.ServerResponse> response = testsController.multipartUploadMultipleFiles(request,file1,file2,file3,user,userId); + response.send(exchange); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsMultipartUploadMultipleFilesHandler_63); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.POST,"/v1/tests/multipart/multiple-files",currentHandler); + + final io.undertow.server.HttpHandler testsMultipartUploadMultipleFilesHandler_64 = new io.undertow.server.HttpHandler() { + @java.lang.Override + public void handleRequest(final io.undertow.server.HttpServerExchange exchange) throws + java.lang.Exception { + exchange.startBlocking(); + if (exchange.isInIoThread()) { + exchange.dispatch(this); + } else { + io.sinistral.proteus.server.ServerRequest request = new io.sinistral.proteus.server.ServerRequest(exchange); + java.nio.file.Path file1 = io.sinistral.proteus.server.Extractors.filePath(exchange,"file1"); + java.nio.file.Path file2 = io.sinistral.proteus.server.Extractors.filePath(exchange,"file2"); + java.nio.file.Path file3 = io.sinistral.proteus.server.Extractors.filePath(exchange,"file3"); + io.sinistral.proteus.test.models.User user = io.sinistral.proteus.server.Extractors.namedModel(exchange,io.sinistral.proteus.test.models.User.class,"user"); + Integer userId = io.sinistral.proteus.server.Extractors.integerValue(exchange,"userId"); + + io.sinistral.proteus.server.ServerResponse> response = testsController.multipartUploadMultipleFiles(request,file1,file2,file3,user,userId); + response.send(exchange); + } + } + }; + + currentHandler = new io.undertow.server.handlers.RequestBufferingHandler.Wrapper(8).wrap(testsMultipartUploadMultipleFilesHandler_64); + currentHandler = ioSinistralProteusTestWrappersTestClassWrapper.wrap(currentHandler); + router.add(io.undertow.util.Methods.POST,"/v1/tests/multipart/multiple-paths",currentHandler); + + + return router; + } +} \ No newline at end of file