use of org.jboss.pnc.bpm.Connector in project pnc by project-ncl.
the class BpmMock method startTask.
@Override
public boolean startTask(BpmTask task) throws CoreException {
Connector connector = Mockito.mock(Connector.class);
try {
Mockito.when(connector.startProcess(Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(1L);
} catch (ProcessManagerException e) {
log.error("Cannot mock start process.", e);
}
task.setConnector(connector);
boolean started = super.startTask(task);
onTaskStarted.ifPresent(supplier -> supplier.accept(task));
return started;
}
Aggregations