Search in sources :

Example 1 with Connector

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;
}
Also used : Connector(org.jboss.pnc.bpm.Connector) ProcessManagerException(org.jboss.pnc.spi.exception.ProcessManagerException)

Aggregations

Connector (org.jboss.pnc.bpm.Connector)1 ProcessManagerException (org.jboss.pnc.spi.exception.ProcessManagerException)1