use of org.jbpm.process.workitem.ethereum.QueryExistingContractWorkitemHandler in project jbpm-work-items by kiegroup.
the class EthereumWorkitemHandlerTest method testQueryExistingContract.
@Test
public void testQueryExistingContract() throws Exception {
TestWorkItemManager manager = new TestWorkItemManager();
WorkItemImpl workItem = new WorkItemImpl();
workItem.setParameter("ServiceURL", "http://localhost:8545/");
workItem.setParameter("ContractAddress", "0x00211e7e");
workItem.setParameter("ContractMethodName", "testQuery");
workItem.setParameter("MethodOutputType", null);
QueryExistingContractWorkitemHandler handler = new QueryExistingContractWorkitemHandler(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