forked from jooby-project/jooby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIssue1573.java
More file actions
34 lines (27 loc) · 859 Bytes
/
Copy pathIssue1573.java
File metadata and controls
34 lines (27 loc) · 859 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package io.jooby;
import io.jooby.i1573.Controller1573;
import io.jooby.junit.ServerTest;
import io.jooby.junit.ServerTestRunner;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class Issue1573 {
@ServerTest
public void issue1573(ServerTestRunner runner) {
runner.define(app -> {
app.get("/edit/{id:[0-9]+}?", ctx -> ctx.path("id").value("own"));
app.mvc(new Controller1573());
}).ready(client -> {
client.get("/edit", rsp -> {
assertEquals("own", rsp.body().string());
});
client.get("/edit/123", rsp -> {
assertEquals("123", rsp.body().string());
});
client.get("/profile", rsp -> {
assertEquals("self", rsp.body().string());
});
client.get("/profile/123", rsp -> {
assertEquals("123", rsp.body().string());
});
});
}
}