use of org.jbpm.process.workitem.ethereum.SendEtherWorkitemHandler in project jbpm-work-items by kiegroup.
the class EthereumWorkitemHandlerTest method testSendEther.
@Test
public void testSendEther() throws Exception {
TestWorkItemManager manager = new TestWorkItemManager();
WorkItemImpl workItem = new WorkItemImpl();
workItem.setParameter("ServiceURL", "http://localhost:8545/");
workItem.setParameter("Amount", "10");
workItem.setParameter("ToAddress", "0x00211e7e");
SendEtherWorkitemHandler handler = new SendEtherWorkitemHandler(TEST_WALLET_PASSWORD, "wallet/testwallet.json");
handler.setWeb3j(web3j);
handler.setTransfer(transfer);
handler.executeWorkItem(workItem, manager);
assertNotNull(manager.getResults());
assertEquals(1, manager.getResults().size());
assertTrue(manager.getResults().containsKey(workItem.getId()));
TransactionReceipt receipt = (TransactionReceipt) manager.getResults().get(workItem.getId()).get("Receipt");
assertNotNull(receipt);
}
Aggregations