@Test public void test005ReadTransaction_ShouldSuccess() throws Exception { DltTransactionResponse dltTransactionResponse = new DltTransactionResponse(); dltTransactionResponse.setDlt(DLT.bitcoin.name()); this.overledgerTransactionResponse.setOverledgerTransactionId(this.transactionId); this.overledgerTransactionResponse.setDltData(Collections.singletonList(dltTransactionResponse)); Mockito.when(this.client.getTransaction(Mockito.anyString(), Mockito.anyString(), eq(OverledgerTransactionResponse.class))).thenReturn(this.overledgerTransactionResponse); OverledgerTransaction overledgerTransaction = this.overledgerSDK.readTransaction(DLT.bitcoin.name(), "TX_HASH"); Assert.assertNotNull(overledgerTransaction); Assert.assertEquals(this.overledgerTransactionResponse, overledgerTransaction); Mockito.verify(this.client, Mockito.only()).getTransaction(this.stringArgumentCaptor.capture(), this.stringArgumentCaptor.capture(), eq(OverledgerTransactionResponse.class)); }
@Override public OverledgerTransaction readTransaction(UUID overledgerTransactionID) throws Exception { OverledgerTransaction overledgerTransaction = null; try { overledgerTransaction = (OverledgerTransactionResponse)this.client.getTransaction(overledgerTransactionID, OverledgerTransactionResponse.class); } catch (Exception e) { this.throwCauseException(e); } return overledgerTransaction; }
DefaultOverledgerSDK implements OverledgerSDK { @Override public OverledgerTransaction readTransaction(UUID overledgerTransactionID) throws Exception { OverledgerTransaction overledgerTransaction = null; try { overledgerTransaction = (OverledgerTransactionResponse)this.client.getTransaction(overledgerTransactionID, OverledgerTransactionResponse.class); } catch (Exception e) { this.throwCauseException(e); } return overledgerTransaction; } }
DefaultOverledgerSDK implements OverledgerSDK { @Override public OverledgerTransaction readTransaction(UUID overledgerTransactionID) throws Exception { OverledgerTransaction overledgerTransaction = null; try { overledgerTransaction = (OverledgerTransactionResponse)this.client.getTransaction(overledgerTransactionID, OverledgerTransactionResponse.class); } catch (Exception e) { this.throwCauseException(e); } return overledgerTransaction; } private  DefaultOverledgerSDK(NETWORK network); private  DefaultOverledgerSDK(NETWORK network, AccountManager accountManager, Client client); }
DefaultOverledgerSDK implements OverledgerSDK { @Override public OverledgerTransaction readTransaction(UUID overledgerTransactionID) throws Exception { OverledgerTransaction overledgerTransaction = null; try { overledgerTransaction = (OverledgerTransactionResponse)this.client.getTransaction(overledgerTransactionID, OverledgerTransactionResponse.class); } catch (Exception e) { this.throwCauseException(e); } return overledgerTransaction; } private  DefaultOverledgerSDK(NETWORK network); private  DefaultOverledgerSDK(NETWORK network, AccountManager accountManager, Client client); NETWORK getNetwork(); @Override void initial(NETWORK network); @Override void addAccount(String dlt, Account account); @Override OverledgerTransaction writeTransaction(OverledgerTransaction ovlTransaction); @Override OverledgerTransaction readTransaction(UUID overledgerTransactionID); @Override OverledgerTransactions readTransactions(String mappId); @Override OverledgerTransactions readTransactions(String mappId, PageParams pageParams); @Override @Deprecated OverledgerTransaction readTransaction(String dlt, String transactionHash); @Override Transaction searchTransaction(String transactionHash, Class<Transaction> responseClass); @Override @Deprecated Address searchAddress(String address, Class<Address> responseClass); @Override Address searchAddress(String address); @Deprecated Block searchBlock(String dlt, String blockhash, Class<Block> responseClass); @Override Block searchBlock(String dlt, String blockhash); @Override Block searchBlock(String dlt, BigDecimal blocknumber); @Override List<BalanceResponse> getBalance(List<BalanceRequest> balanceRequests); @Override SequenceResponse getSequence(SequenceRequest sequenceRequest); OverledgerTransaction writeTransaction(OverledgerTransaction ovlTransaction, byte[] data); OverledgerTransaction writeTransaction(OverledgerTransaction ovlTransaction, InputStream inputStream); static DefaultOverledgerSDK newInstance(NETWORK network); static DefaultOverledgerSDK newInstance(NETWORK network, AccountManager accountManager, Client client); static DefaultOverledgerSDK newInstance(); static DefaultOverledgerSDK newInstance(AccountManager accountManager, Client client); }
DefaultOverledgerSDK implements OverledgerSDK { @Override public OverledgerTransaction readTransaction(UUID overledgerTransactionID) throws Exception { OverledgerTransaction overledgerTransaction = null; try { overledgerTransaction = (OverledgerTransactionResponse)this.client.getTransaction(overledgerTransactionID, OverledgerTransactionResponse.class); } catch (Exception e) { this.throwCauseException(e); } return overledgerTransaction; } private  DefaultOverledgerSDK(NETWORK network); private  DefaultOverledgerSDK(NETWORK network, AccountManager accountManager, Client client); NETWORK getNetwork(); @Override void initial(NETWORK network); @Override void addAccount(String dlt, Account account); @Override OverledgerTransaction writeTransaction(OverledgerTransaction ovlTransaction); @Override OverledgerTransaction readTransaction(UUID overledgerTransactionID); @Override OverledgerTransactions readTransactions(String mappId); @Override OverledgerTransactions readTransactions(String mappId, PageParams pageParams); @Override @Deprecated OverledgerTransaction readTransaction(String dlt, String transactionHash); @Override Transaction searchTransaction(String transactionHash, Class<Transaction> responseClass); @Override @Deprecated Address searchAddress(String address, Class<Address> responseClass); @Override Address searchAddress(String address); @Deprecated Block searchBlock(String dlt, String blockhash, Class<Block> responseClass); @Override Block searchBlock(String dlt, String blockhash); @Override Block searchBlock(String dlt, BigDecimal blocknumber); @Override List<BalanceResponse> getBalance(List<BalanceRequest> balanceRequests); @Override SequenceResponse getSequence(SequenceRequest sequenceRequest); OverledgerTransaction writeTransaction(OverledgerTransaction ovlTransaction, byte[] data); OverledgerTransaction writeTransaction(OverledgerTransaction ovlTransaction, InputStream inputStream); static DefaultOverledgerSDK newInstance(NETWORK network); static DefaultOverledgerSDK newInstance(NETWORK network, AccountManager accountManager, Client client); static DefaultOverledgerSDK newInstance(); static DefaultOverledgerSDK newInstance(AccountManager accountManager, Client client);  }