@Test public void testSerialization(){ UserAccount userAccount = new UserAccount("1.2.139293"); String end = "1.11.225030218"; String start = "1.11.225487973"; int limit = 20; GetAccountHistory getAccountHistory = new GetAccountHistory(userAccount, start, end, limit); ApiCall apiCall = getAccountHistory.toApiCall(2, 3); String serialized = apiCall.toJsonString(); System.out.println("> "+serialized); String expected = "{\"id\":3,\"method\":\"call\",\"params\":[2,\"get_account_history\",[\"1.2.139293\",\"1.11.225030218\",20,\"1.11.225487973\"]],\"jsonrpc\":\"2.0\"}"; Assert.assertEquals("Serialized is as expected", expected, serialized); }
@Override public ApiCall toApiCall(int apiId, long sequenceId) { ArrayList<Serializable> params = new ArrayList<>(); params.add(mUserAccount.getObjectId()); params.add(endOperation); params.add(limit); params.add(startOperation); return new ApiCall(apiId, RPC.CALL_GET_ACCOUNT_HISTORY, params, RPC.VERSION, sequenceId); }
GetAccountHistory implements ApiCallable { @Override public ApiCall toApiCall(int apiId, long sequenceId) { ArrayList<Serializable> params = new ArrayList<>(); params.add(mUserAccount.getObjectId()); params.add(endOperation); params.add(limit); params.add(startOperation); return new ApiCall(apiId, RPC.CALL_GET_ACCOUNT_HISTORY, params, RPC.VERSION, sequenceId); } }
GetAccountHistory implements ApiCallable { @Override public ApiCall toApiCall(int apiId, long sequenceId) { ArrayList<Serializable> params = new ArrayList<>(); params.add(mUserAccount.getObjectId()); params.add(endOperation); params.add(limit); params.add(startOperation); return new ApiCall(apiId, RPC.CALL_GET_ACCOUNT_HISTORY, params, RPC.VERSION, sequenceId); } GetAccountHistory(UserAccount userAccount, String start, String end, int limit);  GetAccountHistory(String userId, String start, String end, int limit); }
GetAccountHistory implements ApiCallable { @Override public ApiCall toApiCall(int apiId, long sequenceId) { ArrayList<Serializable> params = new ArrayList<>(); params.add(mUserAccount.getObjectId()); params.add(endOperation); params.add(limit); params.add(startOperation); return new ApiCall(apiId, RPC.CALL_GET_ACCOUNT_HISTORY, params, RPC.VERSION, sequenceId); } GetAccountHistory(UserAccount userAccount, String start, String end, int limit);  GetAccountHistory(String userId, String start, String end, int limit); @Override ApiCall toApiCall(int apiId, long sequenceId); }
GetAccountHistory implements ApiCallable { @Override public ApiCall toApiCall(int apiId, long sequenceId) { ArrayList<Serializable> params = new ArrayList<>(); params.add(mUserAccount.getObjectId()); params.add(endOperation); params.add(limit); params.add(startOperation); return new ApiCall(apiId, RPC.CALL_GET_ACCOUNT_HISTORY, params, RPC.VERSION, sequenceId); } GetAccountHistory(UserAccount userAccount, String start, String end, int limit);  GetAccountHistory(String userId, String start, String end, int limit); @Override ApiCall toApiCall(int apiId, long sequenceId); static final int REQUIRED_API; }