### Question:
TransactionApiImpl implements TransactionApi { @Override public TransactionResponseDto sendTransaction(TransactionDto tx) { Transaction transaction = TransactionDto.of(tx); return addTx(transaction); } @Autowired  TransactionApiImpl(BranchGroup branchGroup); @Override int getTransactionCountByBlockHash(String branchId, String blockId); @Override int getTransactionCountByBlockNumber(String branchId, long blockNumber); @Override TransactionDto getTransactionByHash(String branchId, String txId); @Override TransactionDto getTransactionByBlockHash(String branchId, String blockId,
                                                     int txIndexPosition); @Override TransactionDto getTransactionByBlockNumber(String branchId, long blockNumber,
                                                       int txIndexPosition); @Override TransactionDto getTransactionByBlockNumber(String branchId, String tag,
                                                       int txIndexPosition); @Override TransactionResponseDto sendTransaction(TransactionDto tx); @Override TransactionResponseDto sendRawTransaction(byte[] bytes); @Override int newPendingTransactionFilter(String branchId); @Override List<String> getPendingTransactionList(String branchId); @Override int getPendingTransactionCount(String branchId); @Override TransactionReceiptDto getTransactionReceipt(String branchId, String txId); @Override String getRawTransaction(String branchId, String txId); @Override String getRawTransactionHeader(String branchId, String txId);  }### Answer:
@Test @Ignore public void sendTransactionTest() { Transaction tx = createTx(); try { TransactionResponseDto res = TX_API.sendTransaction(TransactionDto.createBy(tx)); assertTrue(res.status); } catch (Exception exception) { log.debug("\n\nsendTransactionTest :: exception => " + exception); } }
@Test public void invalidTransactionTest() { Transaction sysErrTx = BlockChainTestUtils.createInvalidTransferTx(ContractVersion.of("696e76616c6964")); Transaction busErrTx = BlockChainTestUtils.createInvalidTransferTx(); try { TransactionResponseDto res = TX_API.sendTransaction(TransactionDto.createBy(sysErrTx)); assertFalse(res.status); res = TX_API.sendTransaction(TransactionDto.createBy(busErrTx)); assertFalse(res.status); } catch (Exception e) { log.debug("\n\ninvalidTransactionTest :: ERR => {}", e.getMessage()); } }
@Ignore @Test public void versioningProposeTxTest() throws Exception { BranchId branchId = BranchId.of(yggdrashBranch); Wallet wallet = ContractTestUtils.createTestWallet("77283a04b3410fe21ba5ed04c7bd3ba89e70b78c.json"); JsonObject txBody = ContractTestUtils.contractProposeTxBodyJson( ContractConstants.VERSIONING_CONTRACT.toString(), "activate"); Transaction tx = new TransactionBuilder() .setType(Hex.decodeHex(ContractConstants.VERSIONING_TRANSACTION)) .setTxBody(txBody) .setWallet(wallet) .setBranchId(branchId) .build(); TransactionResponseDto responseDto = txApi.sendTransaction(TransactionDto.createBy(tx)); assertTrue(responseDto.status); }