Skip to content

Commit 3688bb9

Browse files
committed
Copy route attributes, executorKey while importing routes
1 parent 0a8aecc commit 3688bb9

File tree

2 files changed

+28
-25
lines changed

2 files changed

+28
-25
lines changed

jooby/src/main/java/io/jooby/internal/RouterImpl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,5 +707,8 @@ private void copy(Route src, Route it) {
707707
it.setProduces(src.getProduces());
708708
it.setHandle(src.getHandle());
709709
it.setReturnType(src.getReturnType());
710+
it.setAttributes(src.getAttributes());
711+
it.setExecutorKey(src.getExecutorKey());
712+
it.setHandle(src.getHandle());
710713
}
711714
}

tests/src/test/java/io/jooby/MvcTest.java

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -60,35 +60,35 @@ public void routerInstance() {
6060
});
6161
});
6262
}
63-
63+
6464
@Test
6565
public void routerImporting() {
6666
new JoobyRunner(app -> {
67-
Jooby sub = new Jooby();
68-
sub.mvc(new InstanceRouter());
69-
app.use("/sub", sub);
70-
}).ready(client -> {
71-
client.get("/sub", rsp -> {
72-
assertEquals("Got it!", rsp.body().string());
73-
});
74-
client.post("/sub", rsp -> {
75-
assertEquals("Got it!", rsp.body().string());
76-
});
77-
78-
client.get("/sub/subpath", rsp -> {
79-
assertEquals("OK", rsp.body().string());
80-
});
81-
82-
client.get("/sub/void", rsp -> {
83-
assertEquals("", rsp.body().string());
84-
assertEquals(204, rsp.code());
85-
});
86-
87-
client.get("/sub/voidwriter", rsp -> {
88-
assertEquals("writer", rsp.body().string().trim());
89-
assertEquals(200, rsp.code());
90-
});
67+
Jooby sub = new Jooby();
68+
sub.mvc(new InstanceRouter());
69+
app.use("/sub", sub);
70+
}).ready(client -> {
71+
client.get("/sub", rsp -> {
72+
assertEquals("Got it!", rsp.body().string());
73+
});
74+
client.post("/sub", rsp -> {
75+
assertEquals("Got it!", rsp.body().string());
9176
});
77+
78+
client.get("/sub/subpath", rsp -> {
79+
assertEquals("OK", rsp.body().string());
80+
});
81+
82+
client.get("/sub/void", rsp -> {
83+
assertEquals("", rsp.body().string());
84+
assertEquals(204, rsp.code());
85+
});
86+
87+
client.get("/sub/voidwriter", rsp -> {
88+
assertEquals("writer", rsp.body().string().trim());
89+
assertEquals(200, rsp.code());
90+
});
91+
});
9292
}
9393

9494
@Test

0 commit comments

Comments
 (0)