use of org.jbpm.process.workitem.ethereum.TransactExistingContractWorkitemHandler in project jbpm-work-items by kiegroup.
the class EthereumWorkitemHandlerTest method testTransactExistingContract.
@Test
public void testTransactExistingContract() throws Exception {
TestWorkItemManager manager = new TestWorkItemManager();
WorkItemImpl workItem = new WorkItemImpl();
workItem.setParameter("ServiceURL", "http://localhost:8545/");
workItem.setParameter("ContractAddress", "0x00211e7e");
workItem.setParameter("MethodName", "testQuery");
workItem.setParameter("MethodInputType", null);
workItem.setParameter("WaitForReceipt", "false");
workItem.setParameter("DepositAmount", "10");
TransactExistingContractWorkitemHandler handler = new TransactExistingContractWorkitemHandler(TEST_WALLET_PASSWORD, "wallet/testwallet.json");
handler.setWeb3j(web3j);
handler.executeWorkItem(workItem, manager);
assertNotNull(manager.getResults());
assertEquals(1, manager.getResults().size());
assertTrue(manager.getResults().containsKey(workItem.getId()));
}
Aggregations