@Test
public void routesWithoutPathArg_works() throws Exception {
app.routes(() -> {
path("api", () -> {
get(OK_HANDLER);
post(OK_HANDLER);
put(OK_HANDLER);
delete(OK_HANDLER);
patch(OK_HANDLER);
path("user", () -> {
get(OK_HANDLER);
post(OK_HANDLER);
put(OK_HANDLER);
delete(OK_HANDLER);
patch(OK_HANDLER);
});
});
});
HttpMethod[] httpMethods = new HttpMethod[]{HttpMethod.GET, HttpMethod.POST, HttpMethod.PUT, HttpMethod.DELETE, HttpMethod.PATCH};
for (HttpMethod httpMethod : httpMethods) {
assertThat(call(httpMethod, "/api").getStatus(), is(200));
assertThat(call(httpMethod, "/api/user").getStatus(), is(200));
}
}
TestApiBuilder.java 文件源码
java
阅读 22
收藏 0
点赞 0
评论 0
项目:javalin
作者:
评论列表
文章目录