@Test public void testReservedRespFromJson() { RpcResponse<AddressResponse> response = CONV.responseFromJson(ADDRESS_RESP, AddressResponse.class); Assert.assertNotNull(response); Assert.assertEquals("2.0", response.getJsonrpc()); Assert.assertEquals(6, response.getId()); Assert.assertNotNull(response.getResult()); Assert.assertEquals("FA2jK2HcLnRdS94dEcU27rF3meoJfpUcZPSinpb7AwQvPRY6RL1Q", response.getResult().getPublicAddress()); Assert.assertEquals("Fs3E9gV6DXsYzf7Fqx1fVBQPQXV695eP3k5XbmHEZVRLkMdD9qCK", response.getResult().getSecret()); RpcResponse<WalletBackupResponse> backupResponse = CONV.responseFromJson(WALLET_BACKUP_RESP, WalletBackupResponse.class); Assert.assertNotNull(backupResponse); Assert.assertEquals("2.0", backupResponse.getJsonrpc()); Assert.assertEquals(0, backupResponse.getId()); Assert.assertNotNull(backupResponse.getResult()); Assert.assertEquals("yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow yellow", backupResponse.getResult().getWalletSeed()); }
@Override public <T> RpcResponse<T> responseFromJson(String json, Class<T> resultClass) { ParameterizedType parameterizedType = new ResolvedParameterizedType(RpcResponse.class, new Type[]{resultClass}); return jsonb().fromJson(json, parameterizedType); }
JsonConverterJEE implements JsonConverter { @Override public <T> RpcResponse<T> responseFromJson(String json, Class<T> resultClass) { ParameterizedType parameterizedType = new ResolvedParameterizedType(RpcResponse.class, new Type[]{resultClass}); return jsonb().fromJson(json, parameterizedType); } }
JsonConverterJEE implements JsonConverter { @Override public <T> RpcResponse<T> responseFromJson(String json, Class<T> resultClass) { ParameterizedType parameterizedType = new ResolvedParameterizedType(RpcResponse.class, new Type[]{resultClass}); return jsonb().fromJson(json, parameterizedType); }  }
JsonConverterJEE implements JsonConverter { @Override public <T> RpcResponse<T> responseFromJson(String json, Class<T> resultClass) { ParameterizedType parameterizedType = new ResolvedParameterizedType(RpcResponse.class, new Type[]{resultClass}); return jsonb().fromJson(json, parameterizedType); }  @Override void addAdapter(Type type, Object adapter); @Override JsonConverterJEE configure(Properties properties); @Override RpcErrorResponse errorFromJson(String json); @Override RpcResponse<T> responseFromJson(String json, Class<T> resultClass); @Override T fromJson(String json, Class<T> resultClass); @Override String prettyPrint(String json); @Override String toRpcJson(Object input); @Override String toGenericJson(Object object, Type runtimeType); @Override String getName(); }
JsonConverterJEE implements JsonConverter { @Override public <T> RpcResponse<T> responseFromJson(String json, Class<T> resultClass) { ParameterizedType parameterizedType = new ResolvedParameterizedType(RpcResponse.class, new Type[]{resultClass}); return jsonb().fromJson(json, parameterizedType); }  @Override void addAdapter(Type type, Object adapter); @Override JsonConverterJEE configure(Properties properties); @Override RpcErrorResponse errorFromJson(String json); @Override RpcResponse<T> responseFromJson(String json, Class<T> resultClass); @Override T fromJson(String json, Class<T> resultClass); @Override String prettyPrint(String json); @Override String toRpcJson(Object input); @Override String toGenericJson(Object object, Type runtimeType); @Override String getName(); static final String NAME; }