Package org.camunda.bpm.engine.repository

Examples of org.camunda.bpm.engine.repository.CaseDefinitionQuery.list()


    List<CaseDefinition> caseDefinitions = new ArrayList<CaseDefinition>();
    CaseDefinition mockCaseDefinition = MockProvider.createMockCaseDefinition();
    caseDefinitions.add(mockCaseDefinition);

    CaseDefinitionQuery mockCaseDefinitionQuery = mock(CaseDefinitionQuery.class);
    when(mockCaseDefinitionQuery.list()).thenReturn(caseDefinitions);
    when(mockRepoService.createCaseDefinitionQuery()).thenReturn(mockCaseDefinitionQuery);
  }

  private void createCaseInstanceMock() {
    List<CaseInstance> caseInstances = new ArrayList<CaseInstance>();
View Full Code Here


      .orderByCaseDefinitionKey()
      .asc()
      .orderByCaseDefinitionVersion()
      .desc();

    List<CaseDefinition> caseDefinitions = query.list();
    assertEquals(3, caseDefinitions.size());

    assertEquals("one", caseDefinitions.get(0).getKey());
    assertEquals(2, caseDefinitions.get(0).getVersion());
    assertEquals("one", caseDefinitions.get(1).getKey());
View Full Code Here

    List<CaseDefinition> matchingDefinitions = null;

    if (firstResult != null || maxResults != null) {
      matchingDefinitions = executePaginatedQuery(query, firstResult, maxResults);
    } else {
      matchingDefinitions = query.list();
    }

    for (CaseDefinition definition : matchingDefinitions) {
      CaseDefinitionDto def = CaseDefinitionDto.fromCaseDefinition(definition);
      definitions.add(def);
View Full Code Here

  }

  private CaseDefinitionQuery createMockCaseDefinitionQuery(List<CaseDefinition> mockedDefinitions) {
    CaseDefinitionQuery sampleDefinitionsQuery = mock(CaseDefinitionQuery.class);

    when(sampleDefinitionsQuery.list()).thenReturn(mockedDefinitions);
    when(sampleDefinitionsQuery.count()).thenReturn((long) mockedDefinitions.size());
    when(processEngine.getRepositoryService().createCaseDefinitionQuery()).thenReturn(sampleDefinitionsQuery);

    return sampleDefinitionsQuery;
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.