Package org.camunda.bpm.engine.runtime

Examples of org.camunda.bpm.engine.runtime.ProcessInstanceQuery


    List<ProcessInstance> mockProcessInstanceList = new ArrayList<ProcessInstance>();

    mockProcessInstanceList.add(MockProvider.createMockInstance());
    mockProcessInstanceList.add(MockProvider.createAnotherMockInstance());

    ProcessInstanceQuery instanceQuery = mock(ProcessInstanceQuery.class);

    when(instanceQuery.list()).thenReturn(mockProcessInstanceList);
    when(processEngine.getRuntimeService().createProcessInstanceQuery()).thenReturn(instanceQuery);

    Response response = given()
        .queryParam("processInstanceIds", MockProvider.EXAMPLE_PROCESS_INSTANCE_ID_LIST_WITH_DUP)
      .then()
View Full Code Here


    List<ProcessInstance> mockProcessInstanceList = new ArrayList<ProcessInstance>();

    mockProcessInstanceList.add(MockProvider.createMockInstance());
    mockProcessInstanceList.add(MockProvider.createAnotherMockInstance());

    ProcessInstanceQuery instanceQuery = mock(ProcessInstanceQuery.class);

    when(instanceQuery.list()).thenReturn(mockProcessInstanceList);
    when(processEngine.getRuntimeService().createProcessInstanceQuery()).thenReturn(instanceQuery);

    Map<String, Set<String>> params = new HashMap<String, Set<String>>();
    Set<String> processInstanceIds = MockProvider.createMockSetFromList(MockProvider.EXAMPLE_PROCESS_INSTANCE_ID_LIST);
    params.put("processInstanceIds", processInstanceIds);
View Full Code Here

    Assert.assertEquals(MockProvider.ANOTHER_EXAMPLE_PROCESS_INSTANCE_ID, returnedInstanceId2);
  }

  @Test
  public void testInstanceRetrievalByListWithEmpty() {
    ProcessInstanceQuery instanceQuery = mock(ProcessInstanceQuery.class);

    when(instanceQuery.list()).thenReturn(null);
    String expectedExceptionMessage = "Set of process instance ids is empty";
    doThrow(new ProcessEngineException(expectedExceptionMessage)).when(instanceQuery).processInstanceIds(anySetOf(String.class));
    when(processEngine.getRuntimeService().createProcessInstanceQuery()).thenReturn(instanceQuery);

    String emptyList = "";
View Full Code Here

        .get(PROCESS_INSTANCE_QUERY_URL);
  }

  @Test
  public void testInstanceRetrievalByListWithEmptyAsPost() {
    ProcessInstanceQuery instanceQuery = mock(ProcessInstanceQuery.class);

    when(instanceQuery.list()).thenReturn(null);
    String expectedExceptionMessage = "Set of process instance ids is empty";
    doThrow(new ProcessEngineException(expectedExceptionMessage)).when(instanceQuery).processInstanceIds(anySetOf(String.class));
    when(processEngine.getRuntimeService().createProcessInstanceQuery()).thenReturn(instanceQuery);

    Map<String, Set<String>> params = new HashMap<String, Set<String>>();
View Full Code Here

TOP

Related Classes of org.camunda.bpm.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.