public void testQuerySortingAsc() { List<HistoricVariableInstance> historicVariableInstances = historyService.createHistoricVariableInstanceQuery() .orderByTenantId() .asc() .list(); assertThat(historicVariableInstances.size(), is(2)); assertThat(historicVariableInstances.get(0).getTenantId(), is(TENANT_ONE)); assertEquals(historicVariableInstances.get(0).getValue(), TENANT_ONE_VAR); assertThat(historicVariableInstances.get(1).getTenantId(), is(TENANT_TWO)); assertEquals(historicVariableInstances.get(1).getValue(), TENANT_TWO_VAR); }
public void testQuerySortingDesc() { List<HistoricVariableInstance> historicVariableInstances = historyService.createHistoricVariableInstanceQuery() .orderByTenantId() .desc() .list(); assertThat(historicVariableInstances.size(), is(2)); assertThat(historicVariableInstances.get(0).getTenantId(), is(TENANT_TWO)); assertEquals(historicVariableInstances.get(0).getValue(), TENANT_TWO_VAR); assertThat(historicVariableInstances.get(1).getTenantId(), is(TENANT_ONE)); assertEquals(historicVariableInstances.get(1).getValue(), TENANT_ONE_VAR); }
when(mockVariable.getCaseExecutionId()).thenReturn(caseExecutionId); when(mockVariable.getTaskId()).thenReturn(taskId); when(mockVariable.getTenantId()).thenReturn(tenantId); when(mockVariable.getCreateTime()).thenReturn(createTime); when(mockVariable.getRemovalTime()).thenReturn(removalTime);
public static HistoricVariableInstanceDto fromHistoricVariableInstance(HistoricVariableInstance historicVariableInstance) { HistoricVariableInstanceDto dto = new HistoricVariableInstanceDto(); dto.id = historicVariableInstance.getId(); dto.name = historicVariableInstance.getName(); dto.processDefinitionKey = historicVariableInstance.getProcessDefinitionKey(); dto.processDefinitionId = historicVariableInstance.getProcessDefinitionId(); dto.processInstanceId = historicVariableInstance.getProcessInstanceId(); dto.executionId = historicVariableInstance.getExecutionId(); dto.activityInstanceId = historicVariableInstance.getActivityInstanceId(); dto.caseDefinitionKey = historicVariableInstance.getCaseDefinitionKey(); dto.caseDefinitionId = historicVariableInstance.getCaseDefinitionId(); dto.caseInstanceId = historicVariableInstance.getCaseInstanceId(); dto.caseExecutionId = historicVariableInstance.getCaseExecutionId(); dto.taskId = historicVariableInstance.getTaskId(); dto.tenantId = historicVariableInstance.getTenantId(); dto.state = historicVariableInstance.getState(); dto.createTime = historicVariableInstance.getCreateTime(); dto.removalTime = historicVariableInstance.getRemovalTime(); dto.rootProcessInstanceId = historicVariableInstance.getRootProcessInstanceId(); if(historicVariableInstance.getErrorMessage() == null) { VariableValueDto.fromTypedValue(dto, historicVariableInstance.getTypedValue()); } else { dto.errorMessage = historicVariableInstance.getErrorMessage(); dto.type = VariableValueDto.toRestApiTypeName(historicVariableInstance.getTypeName()); } return dto; }
public static HistoricVariableInstanceDto fromHistoricVariableInstance(HistoricVariableInstance historicVariableInstance) { HistoricVariableInstanceDto dto = new HistoricVariableInstanceDto(); dto.id = historicVariableInstance.getId(); dto.name = historicVariableInstance.getName(); dto.processDefinitionKey = historicVariableInstance.getProcessDefinitionKey(); dto.processDefinitionId = historicVariableInstance.getProcessDefinitionId(); dto.processInstanceId = historicVariableInstance.getProcessInstanceId(); dto.executionId = historicVariableInstance.getExecutionId(); dto.activityInstanceId = historicVariableInstance.getActivityInstanceId(); dto.caseDefinitionKey = historicVariableInstance.getCaseDefinitionKey(); dto.caseDefinitionId = historicVariableInstance.getCaseDefinitionId(); dto.caseInstanceId = historicVariableInstance.getCaseInstanceId(); dto.caseExecutionId = historicVariableInstance.getCaseExecutionId(); dto.taskId = historicVariableInstance.getTaskId(); dto.tenantId = historicVariableInstance.getTenantId(); dto.state = historicVariableInstance.getState(); dto.createTime = historicVariableInstance.getCreateTime(); dto.removalTime = historicVariableInstance.getRemovalTime(); dto.rootProcessInstanceId = historicVariableInstance.getRootProcessInstanceId(); if(historicVariableInstance.getErrorMessage() == null) { VariableValueDto.fromTypedValue(dto, historicVariableInstance.getTypedValue()); } else { dto.errorMessage = historicVariableInstance.getErrorMessage(); dto.type = VariableValueDto.toRestApiTypeName(historicVariableInstance.getTypeName()); } return dto; }
public void testQuerySortingAsc() { List<HistoricVariableInstance> historicVariableInstances = historyService.createHistoricVariableInstanceQuery() .orderByTenantId() .asc() .list(); assertThat(historicVariableInstances.size(), is(2)); assertThat(historicVariableInstances.get(0).getTenantId(), is(TENANT_ONE)); assertEquals(historicVariableInstances.get(0).getValue(), TENANT_ONE_VAR); assertThat(historicVariableInstances.get(1).getTenantId(), is(TENANT_TWO)); assertEquals(historicVariableInstances.get(1).getValue(), TENANT_TWO_VAR); }
public void testQuerySortingDesc() { List<HistoricVariableInstance> historicVariableInstances = historyService.createHistoricVariableInstanceQuery() .orderByTenantId() .desc() .list(); assertThat(historicVariableInstances.size(), is(2)); assertThat(historicVariableInstances.get(0).getTenantId(), is(TENANT_TWO)); assertEquals(historicVariableInstances.get(0).getValue(), TENANT_TWO_VAR); assertThat(historicVariableInstances.get(1).getTenantId(), is(TENANT_ONE)); assertEquals(historicVariableInstances.get(1).getValue(), TENANT_ONE_VAR); }
public static HistoricVariableInstanceDto fromHistoricVariableInstance(HistoricVariableInstance historicVariableInstance) { HistoricVariableInstanceDto dto = new HistoricVariableInstanceDto(); dto.id = historicVariableInstance.getId(); dto.name = historicVariableInstance.getName(); dto.processDefinitionKey = historicVariableInstance.getProcessDefinitionKey(); dto.processDefinitionId = historicVariableInstance.getProcessDefinitionId(); dto.processInstanceId = historicVariableInstance.getProcessInstanceId(); dto.executionId = historicVariableInstance.getExecutionId(); dto.activityInstanceId = historicVariableInstance.getActivityInstanceId(); dto.caseDefinitionKey = historicVariableInstance.getCaseDefinitionKey(); dto.caseDefinitionId = historicVariableInstance.getCaseDefinitionId(); dto.caseInstanceId = historicVariableInstance.getCaseInstanceId(); dto.caseExecutionId = historicVariableInstance.getCaseExecutionId(); dto.taskId = historicVariableInstance.getTaskId(); dto.tenantId = historicVariableInstance.getTenantId(); dto.state = historicVariableInstance.getState(); dto.createTime = historicVariableInstance.getCreateTime(); dto.removalTime = historicVariableInstance.getRemovalTime(); dto.rootProcessInstanceId = historicVariableInstance.getRootProcessInstanceId(); if(historicVariableInstance.getErrorMessage() == null) { VariableValueDto.fromTypedValue(dto, historicVariableInstance.getTypedValue()); } else { dto.errorMessage = historicVariableInstance.getErrorMessage(); dto.type = VariableValueDto.toRestApiTypeName(historicVariableInstance.getTypeName()); } return dto; }