Response { public T getResult() { return result; } Response(); long getId(); void setId(long id); String getJsonrpc(); void setJsonrpc(String jsonrpc); T getResult(); void setResult(T result); Error getError(); void setError(Error error); boolean hasError(); String getRawResponse(); void setRawResponse(String rawResponse);  }
@Test public void testEthSyncingInProgress() { buildResponse( "{\n" + " \"id\":1,\n" + " \"jsonrpc\": \"2.0\",\n" + " \"result\": {\n" + " \"startingBlock\": \"0x384\",\n" + " \"currentBlock\": \"0x386\",\n" + " \"highestBlock\": \"0x454\"\n" + " }\n" + "}" ); EthSyncing ethSyncing = deserialiseResponse(EthSyncing.class); assertThat(ethSyncing.getResult(), CoreMatchers.<EthSyncing.Result>equalTo( new EthSyncing.Syncing("0x384", "0x386", "0x454", null, null))); }
@Test public void testEthSyncingInProgress() { buildResponse( "{\n" + " \"id\":1,\n" + " \"jsonrpc\": \"2.0\",\n" + " \"result\": {\n" + " \"startingBlock\": \"0x384\",\n" + " \"currentBlock\": \"0x386\",\n" + " \"highestBlock\": \"0x454\"\n" + " }\n" + "}" ); PlatonSyncing ethSyncing = deserialiseResponse(PlatonSyncing.class); assertThat(ethSyncing.getResult(), CoreMatchers.<PlatonSyncing.Result>equalTo( new PlatonSyncing.Syncing("0x384", "0x386", "0x454", null, null))); }