@Test
public void testBadVersion() {
thrown.expect(IllegalStateException.class);
thrown.expectMessage(new StringStartsWith("Bad protocol version"));
JsonRpcClient client = new JsonRpcClient(new Transport() {
@NotNull
@Override
public String pass(@NotNull String request) throws IOException {
return "[{\n" +
" \"jsonrpc\": \"1.0\",\n" +
" \"id\": 1,\n" +
" \"result\": {\n" +
" \"firstName\": \"Steven\",\n" +
" \"lastName\": \"Stamkos\",\n" +
" \"team\": {\n" +
" \"name\": \"Tampa Bay Lightning\",\n" +
" \"league\": \"NHL\"\n" +
" },\n" +
" \"number\": 91,\n" +
" \"position\": \"C\",\n" +
" \"birthDate\": \"1990-02-07T00:00:00.000+0000\",\n" +
" \"capHit\": 7.5\n" +
" }\n" +
"}]";
}
});
client.createBatchRequest()
.add(1L, "findPlayer", "Steven", "Stamkos")
.add(2L, "findPlayer", "Vladimir", "Sobotka")
.returnType(Player.class)
.execute();
}
BatchRequestBuilderErrors.java 文件源码
java
阅读 24
收藏 0
点赞 0
评论 0
项目:simple-json-rpc
作者:
评论列表
文章目录