use of org.jbpm.process.workitem.ethereum.GetBalanceWorkitemHandler in project jbpm-work-items by kiegroup.
the class EthereumWorkitemHandlerTest method testGetBalance.
@Test
public void testGetBalance() throws Exception {
TestWorkItemManager manager = new TestWorkItemManager();
WorkItemImpl workItem = new WorkItemImpl();
workItem.setParameter("ServiceURL", "http://localhost:8545/");
GetBalanceWorkitemHandler handler = new GetBalanceWorkitemHandler(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()));
assertTrue((manager.getResults().get(workItem.getId())).get("Balance") instanceof BigDecimal);
BigDecimal balanceResult = (BigDecimal) manager.getResults().get(workItem.getId()).get("Balance");
assertNotNull(balanceResult);
}
Aggregations