@@ -0,0 +1,1920 @@
+package tech.greenfield.vertx.irked;%0A%0Aimport java.util.logging.Logger;%0A%0Aimport org.junit.Test;%0A%0Aimport io.vertx.core.json.JsonObject;%0Aimport io.vertx.ext.unit.Async;%0Aimport io.vertx.ext.unit.TestContext;%0Aimport io.vertx.ext.web.handler.BodyHandler;%0Aimport tech.greenfield.vertx.irked.annotations.Endpoint;%0Aimport tech.greenfield.vertx.irked.annotations.Get;%0Aimport tech.greenfield.vertx.irked.annotations.Put;%0Aimport tech.greenfield.vertx.irked.base.TestBase;%0Aimport tech.greenfield.vertx.irked.status.InternalServerError;%0A%0Apublic class TestRouteCascade extends TestBase %7B%0A%0A%09String fieldName = %22value%22;%0A%0A%09public class TestControllerCascadeField extends Controller %7B%0A%09%09JsonObject data = new JsonObject().put(fieldName, 1);%0A%09%09%0A%09%09@Endpoint(%22/*%22)%0A%09%09BodyHandler bodyHandler = BodyHandler.create();%0A%0A%09%09@Put(%22/%22)%0A%09%09WebHandler update = r -%3E %7B%0A%09%09%09Logger.getAnonymousLogger().warning(%22Starting update%22);%0A%09%09%09rule.vertx().executeBlocking(f -%3E %7B%0A%09%09%09%09data.mergeIn(r.getBodyAsJson());%0A%09%09%09%09Logger.getAnonymousLogger().warning(%22Finished update%22);%0A%09%09%09%09f.complete();%0A%09%09%09%7D, f -%3E %7B%0A%09%09%09%09if (f.failed())%0A%09%09%09%09%09r.sendError(new InternalServerError(f.cause()));%0A%09%09%09%09else%0A%09%09%09%09%09r.next();%0A%09%09%09%7D);%0A%09%09%7D;%0A%0A%09%09@Put(%22/%22)%0A%09%09@Get(%22/%22)%0A%09%09WebHandler retrieve = r -%3E %7B%0A%09%09%09Logger.getAnonymousLogger().warning(%22Starting get%22);%0A%09%09%09r.sendJSON(data);%0A%09%09%7D;%0A%09%7D%0A%0A%09@Test%0A%09public void testCascadingFieldHandlers(TestContext context) %7B%0A%09%09deployController(new TestControllerCascadeField(), context.asyncAssertSuccess(s -%3E executeTest(context)));%0A%09%7D%0A%0A%09private void executeTest(TestContext context) %7B%0A%09%09int newVal = 5;%0A%09%09Async async = context.async();%0A%09%09getClient().put(port, %22localhost%22, %22/%22).handler(r -%3E %7B%0A%09%09%09context.assertEquals(200, r.statusCode(), %22Failed to call PUT%22);%0A%09%09%09r.bodyHandler(body -%3E %7B%0A%09%09%09%09context.assertEquals(newVal, body.toJsonObject().getInteger(fieldName));%0A%09%09%09%09async.complete();%0A%09%09%09%7D);%0A%09%09%7D).end(new JsonObject().put(fieldName, newVal).encode());%0A%09%7D%0A%0A%7D%0A

add cascading routes test