forked from jooby-project/jooby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIssue2372.java
More file actions
46 lines (36 loc) · 1.08 KB
/
Copy pathIssue2372.java
File metadata and controls
46 lines (36 loc) · 1.08 KB
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
37
38
39
40
41
42
43
44
45
46
package io.jooby;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.Arrays;
import io.jooby.junit.ServerTest;
import io.jooby.junit.ServerTestRunner;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
public class Issue2372 {
@ServerTest
public void http2(ServerTestRunner runner) {
runner.define(app -> {
app.setServerOptions(
new ServerOptions()
.setHttp2(true)
.setSecurePort(8443)
);
app.before(new SSLHandler());
app.get("/2372/mono", ctx -> {
return Mono.fromCallable(() -> "Welcome to Jooby!");
});
app.get("/2372/flux", ctx -> {
return Flux.fromIterable(Arrays.asList("Welcome", "to", "Jooby!"))
.map(it -> it + " ");
});
}).ready((http, https) -> {
https.get("/2372/flux", rsp -> {
assertEquals("Welcome to Jooby!",
rsp.body().string().trim());
});
https.get("/2372/mono", rsp -> {
assertEquals("Welcome to Jooby!",
rsp.body().string());
});
});
}
}