use of org.jbpm.process.workitem.core.TestWorkItemManager in project jbpm by kiegroup.
the class WebServiceWorkItemHandlerTest method testExecuteSyncOperation.
@Test
public void testExecuteSyncOperation() throws Exception {
when(clients.containsKey(anyObject())).thenReturn(true);
when(clients.get(anyObject())).thenReturn(client);
TestWorkItemManager manager = new TestWorkItemManager();
WorkItemImpl workItem = new WorkItemImpl();
workItem.setParameter("Interface", "someInterface");
workItem.setParameter("Operation", "someOperation");
workItem.setParameter("Parameter", "myParam");
workItem.setParameter("Mode", "SYNC");
WebServiceWorkItemHandler handler = new WebServiceWorkItemHandler(kieSession);
handler.setClients(clients);
handler.executeWorkItem(workItem, manager);
assertNotNull(manager.getResults());
assertEquals(1, manager.getResults().size());
assertTrue(manager.getResults().containsKey(workItem.getId()));
}
Aggregations