@Test
public void test_moreSpecificException_isHandledFirst() throws Exception {
app.get("/exception-priority", ctx -> {
throw new TypedException();
}).exception(Exception.class, (e, ctx) -> {
ctx.result("This shouldn't run");
}).exception(TypedException.class, (e, ctx) -> {
ctx.result("Typed!");
});
HttpResponse<String> response = GET_asString("/exception-priority");
assertThat(response.getBody(), is("Typed!"));
assertThat(response.getStatus(), is(200));
}
TestExceptionMapper.java 文件源码
java
阅读 22
收藏 0
点赞 0
评论 0
项目:javalin
作者:
评论列表
文章目录