Skip to content

Commit 067663b

Browse files
committed
Add test for multi-path values
1 parent cc51669 commit 067663b

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

modules/jooby-apt/src/test/java/source/Routes.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,14 @@ public String pathAttributeWork(Context ctx) {
4747
public String pathvalue(Context ctx) {
4848
return ctx.pathString();
4949
}
50+
51+
@GET(value = {"/path1", "/path2"})
52+
public String pathvalueArray(Context ctx) {
53+
return ctx.pathString();
54+
}
55+
56+
@POST(path = {"/path1", "/path2"})
57+
public String pathArray(Context ctx) {
58+
return ctx.pathString();
59+
}
5060
}

modules/jooby-apt/src/test/java/tests/ModuleCompilerTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ public void routes() throws Exception {
2727
assertEquals("/path/pathAttributeWork", router.get("/path/pathAttributeWork").value());;
2828
assertEquals("/path/path", router.get("/path/path").value());;
2929
assertEquals("/path/value", router.get("/path/value").value());;
30+
31+
assertEquals("/path/path1", router.get("/path/path1").value());
32+
assertEquals("/path/path2", router.get("/path/path2").value());
33+
34+
assertEquals("/path/path1", router.post("/path/path1").value());
35+
assertEquals("/path/path2", router.post("/path/path2").value());
3036
});
3137
}
3238

0 commit comments

Comments
 (0)