forked from jooby-project/jooby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIssue2399.java
More file actions
36 lines (27 loc) · 899 Bytes
/
Copy pathIssue2399.java
File metadata and controls
36 lines (27 loc) · 899 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
35
36
package io.jooby.i2399;
import static org.junit.jupiter.api.Assertions.assertEquals;
import io.jooby.ServerOptions;
import io.jooby.junit.ServerTest;
import io.jooby.junit.ServerTestRunner;
public class Issue2399 {
@ServerTest
public void shouldHttp2NotLostStreamIdOnException(ServerTestRunner runner) {
runner.define(app -> {
ServerOptions options = new ServerOptions();
options.setHttp2(true);
options.setSecurePort(8443);
app.setServerOptions(options);
app.error((ctx, cause, code) -> {
ctx.send(cause.getMessage());
});
app.get("/2399", ctx -> ctx.query("q").value());
}).ready((http, https) -> {
https.get("/2399", rsp -> {
assertEquals("Missing value: 'q'", rsp.body().string());
});
https.get("/2399/404", rsp -> {
assertEquals("/2399/404", rsp.body().string());
});
});
}
}