Skip to content
This repository was archived by the owner on Jan 3, 2019. It is now read-only.

Commit 07f7e18

Browse files
author
Adrian Cole
committed
Backfills missing tests
1 parent 29a9beb commit 07f7e18

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/test/java/brave/http/ITServerTracingModule.java

+12-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22

33
import com.google.inject.Module;
44
import com.google.inject.util.Modules;
5+
import ratpack.exec.Promise;
56
import ratpack.guice.Guice;
6-
import ratpack.http.Status;
77
import ratpack.test.embed.EmbeddedApp;
88
import ratpack.zipkin.ServerTracingModule;
99

10+
import java.io.IOException;
1011
import java.net.URI;
1112

1213
public class ITServerTracingModule extends ITHttpServer {
@@ -21,14 +22,23 @@ protected void init() throws Exception {
2122
server.registry(Guice.registry(binding -> binding.module(tracingModule)))
2223
.handlers(chain -> chain
2324
.get("/foo", ctx -> ctx.getResponse().send("bar"))
25+
.get("/async", ctx ->
26+
Promise.async(f -> f.success("bar")).then(ctx::render)
27+
)
2428
.get("/badrequest", ctx -> ctx.getResponse().status(400).send())
2529
.get("/child", ctx -> {
2630
HttpTracing httpTracing = ctx.get(HttpTracing.class);
2731
httpTracing.tracing().tracer().nextSpan().name("child").start().finish();
2832
ctx.getResponse().send("happy");
2933
})
3034
.get("/extra", ctx -> ctx.getResponse().send("joey"))
31-
.all(ctx -> ctx.getResponse().status(500).send()))
35+
.get("/exception", ctx -> {
36+
throw new IOException();
37+
})
38+
.get("/exceptionAsync",
39+
ctx -> Promise.async((f) -> f.error(new IOException())).then(ctx::render)
40+
)
41+
.all(ctx -> ctx.getResponse().status(404).send()))
3242
);
3343
}
3444

0 commit comments

Comments
 (0)