Package org.activiti.engine.runtime

Examples of org.activiti.engine.runtime.ProcessInstanceQuery


            newProcessInstanceMock("p2", BUSINESS_KEY, false),
            newProcessInstanceMock("p3", BUSINESS_KEY, true)
        );

        final RuntimeService runtimeService = mock(RuntimeService.class);
        final ProcessInstanceQuery processInstanceQuery = mock(ProcessInstanceQuery.class);

        when(engine.getRuntimeService()).thenReturn(runtimeService);
        when(runtimeService.createProcessInstanceQuery()).thenReturn(processInstanceQuery);
        when(processInstanceQuery.variableValueEquals(CoreProcessVariables.POOL_BUSINESS_KEY, BUSINESS_KEY))
            .thenReturn(processInstanceQuery);
        when(processInstanceQuery.orderByProcessInstanceId()).thenReturn(processInstanceQuery);
        when(processInstanceQuery.desc()).thenReturn(processInstanceQuery);
        when(processInstanceQuery.list()).thenReturn(processes);

        return engine;
    }
View Full Code Here


    protected RuntimeService mockRuntimeService(Map<String, ProcessInstance> instances,
                                              String... notFoundProcessInstanceIds) {
        RuntimeService runtimeService = mock(RuntimeService.class);

        ProcessInstanceQuery generalQuery = mock(ProcessInstanceQuery.class);
        for (Map.Entry<String, ProcessInstance> entry : instances.entrySet()) {
            ProcessInstanceQuery specificQuery = mock(ProcessInstanceQuery.class);
            when(specificQuery.singleResult()).thenReturn(entry.getValue());

            when(generalQuery.processInstanceId(eq(entry.getKey()))).thenReturn(specificQuery);
        }
        for (String notFound : notFoundProcessInstanceIds) {
            /* create a mock that returns null for all method calls (default) */
 
View Full Code Here

TOP

Related Classes of org.activiti.engine.runtime.ProcessInstanceQuery

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.