@Test public void testCommit() throws Exception { final TransactionTemplate transactionTemplate = new TransactionTemplate(contextStorage); final Requester mockRequester = mock(Requester.class); final TxHash expected = TxHash.of(BytesValue.EMPTY); when(mockRequester.request(ArgumentMatchers.<Invocation<?>>any())) .thenReturn(expected); transactionTemplate.requester = mockRequester; final TxHash actual = transactionTemplate.commit(anyTransaction); assertEquals(expected, actual); }
@Override public TxHash commit(final Transaction transaction) { return request(transactionMethods.getCommit(), Arrays.<Object>asList(transaction)); }
TransactionTemplate extends AbstractTemplate implements TransactionOperation { @Override public TxHash commit(final Transaction transaction) { return request(transactionMethods.getCommit(), Arrays.<Object>asList(transaction)); } }
TransactionTemplate extends AbstractTemplate implements TransactionOperation { @Override public TxHash commit(final Transaction transaction) { return request(transactionMethods.getCommit(), Arrays.<Object>asList(transaction)); } TransactionTemplate(final ContextStorage<Context> contextStorage); }
TransactionTemplate extends AbstractTemplate implements TransactionOperation { @Override public TxHash commit(final Transaction transaction) { return request(transactionMethods.getCommit(), Arrays.<Object>asList(transaction)); } TransactionTemplate(final ContextStorage<Context> contextStorage); @Override Transaction getTransaction(final TxHash txHash); @Override TxReceipt getTxReceipt(TxHash txHash); @Override TxHash commit(final Transaction transaction); @Override TxHash sendTx(final Signer signer, final AccountAddress recipient, final Aer amount,
      final long nonce, final Fee fee, final BytesValue payload); @Override TxHash sendTx(final Signer signer, final Name recipient, final Aer amount,
      final long nonce, final Fee fee, final BytesValue payload); }
TransactionTemplate extends AbstractTemplate implements TransactionOperation { @Override public TxHash commit(final Transaction transaction) { return request(transactionMethods.getCommit(), Arrays.<Object>asList(transaction)); } TransactionTemplate(final ContextStorage<Context> contextStorage); @Override Transaction getTransaction(final TxHash txHash); @Override TxReceipt getTxReceipt(TxHash txHash); @Override TxHash commit(final Transaction transaction); @Override TxHash sendTx(final Signer signer, final AccountAddress recipient, final Aer amount,
      final long nonce, final Fee fee, final BytesValue payload); @Override TxHash sendTx(final Signer signer, final Name recipient, final Aer amount,
      final long nonce, final Fee fee, final BytesValue payload);  }