forked from jooby-project/jooby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIssue1344.java
More file actions
33 lines (25 loc) · 764 Bytes
/
Issue1344.java
File metadata and controls
33 lines (25 loc) · 764 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
package io.jooby;
import io.jooby.junit.ServerTest;
import io.jooby.junit.ServerTestRunner;
import org.junit.jupiter.api.DisplayName;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class Issue1344 {
public static class App1344 extends Jooby {
{
decorator(next -> ctx -> "<" + next.apply(ctx) + ">");
get("/1344", Context::pathString);
}
}
@ServerTest
@DisplayName("Decorator from composition")
public void issue1338(ServerTestRunner runner) {
runner.define(app -> {
app.decorator(next -> ctx -> "[" + next.apply(ctx) + "]");
app.use(new App1344());
}).ready(client -> {
client.get("/1344", rsp -> {
assertEquals("[</1344>]", rsp.body().string());
});
});
}
}