forked from jooby-project/jooby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIssue2457.java
More file actions
38 lines (29 loc) · 1.08 KB
/
Copy pathIssue2457.java
File metadata and controls
38 lines (29 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
package io.jooby.i2457;
import static org.junit.jupiter.api.Assertions.assertEquals;
import io.jooby.di.GuiceModule;
import io.jooby.junit.ServerTest;
import io.jooby.junit.ServerTestRunner;
public class Issue2457 {
@ServerTest
public void shouldFindServiceOnMountedApp(ServerTestRunner runner) {
runner.define(app -> {
app.install(new GuiceModule());
app.mvc(HealthController2457.class);
app.mount("/api/v1", new ControllersAppV12457());
app.mount("/api/v2", new ControllersAppV22457());
}).ready(http -> {
http.get("/healthcheck", rsp -> {
assertEquals(200, rsp.code());
assertEquals("{status=Ok, welcome=[API healthcheck] Welcome Jooby!}", rsp.body().string());
});
http.get("/api/v1/welcome", rsp -> {
assertEquals(200, rsp.code());
assertEquals("[API v1] Welcome Jooby!", rsp.body().string());
});
http.get("/api/v2/welcome", rsp -> {
assertEquals(200, rsp.code());
assertEquals("[API v2] Welcome Jooby!", rsp.body().string());
});
});
}
}