Skip to content

Commit a92bc59

Browse files
committed
Add unit tests for jooby-project#1397
1 parent 7498e16 commit a92bc59

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,36 @@ public void routerInstance() {
6060
});
6161
});
6262
}
63+
64+
@Test
65+
public void routerImporting() {
66+
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+
});
91+
});
92+
}
6393

6494
@Test
6595
public void producesAndConsumes() {

0 commit comments

Comments
 (0)