From b506419d41daab8010ba882d8a542c8d786cfa3a Mon Sep 17 00:00:00 2001 From: Jan Rohwer Date: Fri, 5 Apr 2024 12:03:18 +0200 Subject: [PATCH] extend test coverage --- .../rest/adapter/BatchAdapterTest.kt | 39 +++++++++++++ .../rest/adapter/DeploymentAdapterTest.kt | 32 +++++++++++ .../adapter/EventSubscriptionAdapterTest.kt | 32 +++++++++++ .../HistoricProcessInstanceAdapterTest.kt | 47 ++++++++++++++++ .../rest/adapter/IdentityLinkAdapterTest.kt | 48 ++++++++++++++++ .../rest/adapter/IncidentAdapterTest.kt | 40 ++++++++++++++ .../adapter/ProcessDefinitionAdapterTest.kt | 39 +++++++++++++ .../community/rest/adapter/TaskAdapterTest.kt | 52 ++++++++++++++++++ .../DelegatingDeploymentBuilderTest.kt | 43 ++++++++++++--- .../RemoteExternalTaskQueryBuilderTest.kt | 10 +++- .../query/DelegatingExecutionQueryTest.kt | 6 ++ ...egatingHistoricProcessInstanceQueryTest.kt | 4 ++ .../impl/query/DelegatingTaskQueryTest.kt | 21 +++++++ .../core/src/test/resources/test-resource.zip | Bin 0 -> 148 bytes 14 files changed, 405 insertions(+), 8 deletions(-) create mode 100644 extension/core/src/test/kotlin/org/camunda/community/rest/adapter/BatchAdapterTest.kt create mode 100644 extension/core/src/test/kotlin/org/camunda/community/rest/adapter/DeploymentAdapterTest.kt create mode 100644 extension/core/src/test/kotlin/org/camunda/community/rest/adapter/EventSubscriptionAdapterTest.kt create mode 100644 extension/core/src/test/kotlin/org/camunda/community/rest/adapter/HistoricProcessInstanceAdapterTest.kt create mode 100644 extension/core/src/test/kotlin/org/camunda/community/rest/adapter/IdentityLinkAdapterTest.kt create mode 100644 extension/core/src/test/kotlin/org/camunda/community/rest/adapter/IncidentAdapterTest.kt create mode 100644 extension/core/src/test/kotlin/org/camunda/community/rest/adapter/ProcessDefinitionAdapterTest.kt create mode 100644 extension/core/src/test/kotlin/org/camunda/community/rest/adapter/TaskAdapterTest.kt create mode 100644 extension/core/src/test/resources/test-resource.zip diff --git a/extension/core/src/test/kotlin/org/camunda/community/rest/adapter/BatchAdapterTest.kt b/extension/core/src/test/kotlin/org/camunda/community/rest/adapter/BatchAdapterTest.kt new file mode 100644 index 00000000..24a6ed4c --- /dev/null +++ b/extension/core/src/test/kotlin/org/camunda/community/rest/adapter/BatchAdapterTest.kt @@ -0,0 +1,39 @@ +package org.camunda.community.rest.adapter + +import org.assertj.core.api.Assertions +import org.camunda.community.rest.client.model.BatchDto +import org.junit.Test +import java.time.OffsetDateTime + +class BatchAdapterTest { + private val dto = BatchDto() + .id("id") + .tenantId("tenantId") + .type("type") + .totalJobs(1) + .jobsCreated(1) + .batchJobsPerSeed(1) + .invocationsPerBatchJob(1) + .batchJobDefinitionId("batchJobDefinitionId") + .seedJobDefinitionId("seedJobDefinitionId") + .monitorJobDefinitionId("monitorJobDefinitionId") + .suspended(false) + .createUserId("createUserId") + .startTime(OffsetDateTime.now()) + .executionStartTime(OffsetDateTime.now()) + + @Test + fun `should delegate`() { + val batchBean = BatchBean.fromDto(dto) + val batchAdapter = BatchAdapter(batchBean) + Assertions.assertThat(batchAdapter).usingRecursiveComparison().ignoringFields("batchBean").isEqualTo(batchBean) + } + + @Test + fun `should construct from dto`() { + val bean = BatchBean.fromDto(dto) + Assertions.assertThat(bean).usingRecursiveComparison().ignoringFields("startTime", "executionStartTime").isEqualTo(dto) + Assertions.assertThat(bean.startTime).isEqualTo(dto.startTime.toInstant()) + Assertions.assertThat(bean.executionStartTime).isEqualTo(dto.executionStartTime.toInstant()) + } +} diff --git a/extension/core/src/test/kotlin/org/camunda/community/rest/adapter/DeploymentAdapterTest.kt b/extension/core/src/test/kotlin/org/camunda/community/rest/adapter/DeploymentAdapterTest.kt new file mode 100644 index 00000000..093ec3d5 --- /dev/null +++ b/extension/core/src/test/kotlin/org/camunda/community/rest/adapter/DeploymentAdapterTest.kt @@ -0,0 +1,32 @@ +package org.camunda.community.rest.adapter + +import org.assertj.core.api.Assertions +import org.camunda.community.rest.client.model.AtomLink +import org.camunda.community.rest.client.model.DeploymentDto +import org.junit.Test +import java.time.OffsetDateTime + +class DeploymentAdapterTest { + private val dto = DeploymentDto() + .id("id") + .tenantId("tenantId") + .links(listOf(AtomLink())) + .deploymentTime(OffsetDateTime.now()) + .source("source") + .name("name") + + @Test + fun `should delegate`() { + val bean = DeploymentBean.fromDto(dto) + val adapter = DeploymentAdapter(bean) + Assertions.assertThat(adapter).usingRecursiveComparison().ignoringFields("deploymentBean").isEqualTo(bean) + } + + @Test + fun `should construct from dto`() { + val bean = DeploymentBean.fromDto(dto) + Assertions.assertThat(bean).usingRecursiveComparison().ignoringFields("deploymentTime", "deployedProcessDefinitions", + "deployedCaseDefinitions", "deployedDecisionDefinitions", "deployedDecisionRequirementsDefinitions").isEqualTo(dto) + Assertions.assertThat(bean.deploymentTime).isEqualTo(dto.deploymentTime.toInstant()) + } +} diff --git a/extension/core/src/test/kotlin/org/camunda/community/rest/adapter/EventSubscriptionAdapterTest.kt b/extension/core/src/test/kotlin/org/camunda/community/rest/adapter/EventSubscriptionAdapterTest.kt new file mode 100644 index 00000000..8e4919e6 --- /dev/null +++ b/extension/core/src/test/kotlin/org/camunda/community/rest/adapter/EventSubscriptionAdapterTest.kt @@ -0,0 +1,32 @@ +package org.camunda.community.rest.adapter + +import org.assertj.core.api.Assertions +import org.camunda.community.rest.client.model.EventSubscriptionDto +import org.junit.Test +import java.time.OffsetDateTime + +class EventSubscriptionAdapterTest { + private val dto = EventSubscriptionDto() + .id("id") + .tenantId("tenantId") + .eventType("eventType") + .eventName("eventName") + .executionId("executionId") + .processInstanceId("processInstanceId") + .activityId("activityId") + .createdDate(OffsetDateTime.now()) + + @Test + fun `should delegate`() { + val bean = EventSubscriptionBean.fromDto(dto) + val adapter = EventSubscriptionAdapter(bean) + Assertions.assertThat(adapter).usingRecursiveComparison().ignoringFields("eventSubscriptionBean").isEqualTo(bean) + } + + @Test + fun `should construct from dto`() { + val bean = EventSubscriptionBean.fromDto(dto) + Assertions.assertThat(bean).usingRecursiveComparison().ignoringFields("createdDate").isEqualTo(dto) + Assertions.assertThat(bean.createdDate).isEqualTo(dto.createdDate.toInstant()) + } +} diff --git a/extension/core/src/test/kotlin/org/camunda/community/rest/adapter/HistoricProcessInstanceAdapterTest.kt b/extension/core/src/test/kotlin/org/camunda/community/rest/adapter/HistoricProcessInstanceAdapterTest.kt new file mode 100644 index 00000000..55cd01de --- /dev/null +++ b/extension/core/src/test/kotlin/org/camunda/community/rest/adapter/HistoricProcessInstanceAdapterTest.kt @@ -0,0 +1,47 @@ +package org.camunda.community.rest.adapter + +import org.assertj.core.api.Assertions +import org.camunda.community.rest.client.model.HistoricProcessInstanceDto +import org.junit.Test +import java.time.OffsetDateTime + +class HistoricProcessInstanceAdapterTest { + private val dto = HistoricProcessInstanceDto() + .id("id") + .tenantId("tenantId") + .rootProcessInstanceId("rootProcessInstanceId") + .superProcessInstanceId("superProcessInstanceId") + .superCaseInstanceId("superCaseInstanceId") + .caseInstanceId("caseInstanceId") + .processDefinitionName("processDefinitionName") + .processDefinitionKey("processDefinitionKey") + .processDefinitionVersion(1) + .processDefinitionId("processDefinitionId") + .businessKey("businessKey") + .startTime(OffsetDateTime.now()) + .endTime(OffsetDateTime.now()) + .removalTime(OffsetDateTime.now()) + .durationInMillis(1000) + .startUserId("startUserId") + .startActivityId("startActivityId") + .deleteReason("deleteReason") + .state(HistoricProcessInstanceDto.StateEnum.ACTIVE) + + + @Test + fun `should delegate`() { + val bean = HistoricInstanceBean.fromHistoricProcessInstanceDto(dto) + val adapter = HistoricProcessInstanceAdapter(bean) + Assertions.assertThat(adapter).usingRecursiveComparison().ignoringFields("historicInstanceBean").isEqualTo(bean) + } + + @Test + fun `should construct from dto`() { + val bean = HistoricInstanceBean.fromHistoricProcessInstanceDto(dto) + Assertions.assertThat(bean).usingRecursiveComparison().ignoringFields("startTime", "endTime", "removalTime", "endActivityId", "state").isEqualTo(dto) + Assertions.assertThat(bean.startTime).isEqualTo(dto.startTime.toInstant()) + Assertions.assertThat(bean.endTime).isEqualTo(dto.endTime.toInstant()) + Assertions.assertThat(bean.removalTime).isEqualTo(dto.removalTime.toInstant()) + Assertions.assertThat(bean.state).isEqualTo(dto.state.name) + } +} diff --git a/extension/core/src/test/kotlin/org/camunda/community/rest/adapter/IdentityLinkAdapterTest.kt b/extension/core/src/test/kotlin/org/camunda/community/rest/adapter/IdentityLinkAdapterTest.kt new file mode 100644 index 00000000..efe17aba --- /dev/null +++ b/extension/core/src/test/kotlin/org/camunda/community/rest/adapter/IdentityLinkAdapterTest.kt @@ -0,0 +1,48 @@ +/*- + * #%L + * camunda-platform-7-rest-client-spring-boot + * %% + * Copyright (C) 2019 Camunda Services GmbH + * %% + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ +package org.camunda.community.rest.adapter + +import org.assertj.core.api.Assertions.assertThat +import org.camunda.community.rest.client.model.IdentityLinkDto +import org.junit.Test + +class IdentityLinkAdapterTest { + + private val dto = IdentityLinkDto() + .userId("userId") + .groupId("groupId") + .type("candidate") + + @Test + fun `should delegate`() { + val bean = IdentityLinkBean.fromDto("taskId", dto) + val adapter = IdentityLinkAdapter(bean) + assertThat(adapter).usingRecursiveComparison().ignoringFields("identityLinkBean").isEqualTo(bean) + } + + @Test + fun `should construct from dto`() { + val bean = IdentityLinkBean.fromDto("taskId", dto) + assertThat(bean).usingRecursiveComparison().ignoringFields("processDefinitionId", "tenantId", "id", "taskId").isEqualTo(dto) + } +} diff --git a/extension/core/src/test/kotlin/org/camunda/community/rest/adapter/IncidentAdapterTest.kt b/extension/core/src/test/kotlin/org/camunda/community/rest/adapter/IncidentAdapterTest.kt new file mode 100644 index 00000000..ada8536f --- /dev/null +++ b/extension/core/src/test/kotlin/org/camunda/community/rest/adapter/IncidentAdapterTest.kt @@ -0,0 +1,40 @@ +package org.camunda.community.rest.adapter + +import org.assertj.core.api.Assertions +import org.camunda.community.rest.client.model.IncidentDto +import org.junit.Test +import java.time.OffsetDateTime + +class IncidentAdapterTest { + private val dto = IncidentDto() + .id("id") + .tenantId("tenantId") + .processDefinitionId("processDefinitionId") + .processInstanceId("processInstanceId") + .executionId("executionId") + .incidentTimestamp(OffsetDateTime.now()) + .incidentType("incidentType") + .activityId("activityId") + .failedActivityId("failedActivityId") + .causeIncidentId("causeIncidentId") + .rootCauseIncidentId("rootCauseIncidentId") + ._configuration("_configuration") + .tenantId("tenantId") + .incidentMessage("incidentMessage") + .jobDefinitionId("jobDefinitionId") + .annotation("annotation") + + @Test + fun `should delegate`() { + val bean = IncidentBean.fromDto(dto) + val adapter = IncidentAdapter(bean) + Assertions.assertThat(adapter).usingRecursiveComparison().ignoringFields("incidentBean").isEqualTo(bean) + } + + @Test + fun `should construct from dto`() { + val bean = IncidentBean.fromDto(dto) + Assertions.assertThat(bean).usingRecursiveComparison().ignoringFields("incidentTimestamp", "configuration", "historyConfiguration").isEqualTo(dto) + Assertions.assertThat(bean.incidentTimestamp).isEqualTo(dto.incidentTimestamp.toInstant()) + } +} diff --git a/extension/core/src/test/kotlin/org/camunda/community/rest/adapter/ProcessDefinitionAdapterTest.kt b/extension/core/src/test/kotlin/org/camunda/community/rest/adapter/ProcessDefinitionAdapterTest.kt new file mode 100644 index 00000000..6e471d65 --- /dev/null +++ b/extension/core/src/test/kotlin/org/camunda/community/rest/adapter/ProcessDefinitionAdapterTest.kt @@ -0,0 +1,39 @@ +package org.camunda.community.rest.adapter + +import org.assertj.core.api.Assertions +import org.camunda.community.rest.client.model.ProcessDefinitionDto +import org.junit.Test + +class ProcessDefinitionAdapterTest { + private val dto = ProcessDefinitionDto() + .id("id") + .tenantId("tenantId") + .key("key") + .category("category") + .description("description") + .name("name") + .version(1) + .resource("resource") + .deploymentId("deploymentId") + .diagram("diagram") + .suspended(false) + .tenantId("tenantId") + .versionTag("versionTag") + .historyTimeToLive(1) + .startableInTasklist(true) + + + @Test + fun `should delegate`() { + val bean = ProcessDefinitionBean.fromDto(dto) + val adapter = ProcessDefinitionAdapter(bean) + Assertions.assertThat(adapter).usingRecursiveComparison().ignoringFields("processDefinitionBean").isEqualTo(bean) + } + + @Test + fun `should construct from dto`() { + val bean = ProcessDefinitionBean.fromDto(dto) + Assertions.assertThat(bean).usingRecursiveComparison().ignoringFields("resourceName", "diagramResourceName", "startableInTaskList", "hasStartFormKey").isEqualTo(dto) + Assertions.assertThat(bean.startableInTaskList).isEqualTo(dto.startableInTasklist) + } +} diff --git a/extension/core/src/test/kotlin/org/camunda/community/rest/adapter/TaskAdapterTest.kt b/extension/core/src/test/kotlin/org/camunda/community/rest/adapter/TaskAdapterTest.kt new file mode 100644 index 00000000..9ca54967 --- /dev/null +++ b/extension/core/src/test/kotlin/org/camunda/community/rest/adapter/TaskAdapterTest.kt @@ -0,0 +1,52 @@ +package org.camunda.community.rest.adapter + +import org.assertj.core.api.Assertions +import org.camunda.community.rest.client.model.CamundaFormRef +import org.camunda.community.rest.client.model.TaskDto +import org.junit.Test +import java.time.OffsetDateTime + +class TaskAdapterTest { + private val dto = TaskDto() + .id("id") + .tenantId("tenantId") + .name("name") + .assignee("assignee") + .owner("owner") + .created(OffsetDateTime.now()) + .lastUpdated(OffsetDateTime.now()) + .due(OffsetDateTime.now()) + .followUp(OffsetDateTime.now()) + .delegationState(TaskDto.DelegationStateEnum.RESOLVED) + .description("description") + .executionId("executionId") + .parentTaskId("parentTaskId") + .priority(1) + .processDefinitionId("processDefinitionId") + .processInstanceId("processInstanceId") + .caseExecutionId("caseExecutionId") + .caseDefinitionId("caseDefinitionId") + .caseInstanceId("caseInstanceId") + .taskDefinitionKey("taskDefinitionKey") + .suspended(false) + .formKey("formKey") + .camundaFormRef(CamundaFormRef().key("key").binding("binding").version(1)) + + + @Test + fun `should delegate`() { + val bean = TaskBean.fromDto(dto) + val adapter = TaskAdapter(bean) + Assertions.assertThat(adapter).usingRecursiveComparison().ignoringFields("taskBean").isEqualTo(bean) + } + + @Test + fun `should construct from dto`() { + val bean = TaskBean.fromDto(dto) + Assertions.assertThat(bean).usingRecursiveComparison().ignoringFields("created", "lastUpdated", "due", "followUp", "processExecutionId").isEqualTo(dto) + Assertions.assertThat(bean.created).isEqualTo(dto.created.toInstant()) + Assertions.assertThat(bean.lastUpdated).isEqualTo(dto.lastUpdated.toInstant()) + Assertions.assertThat(bean.due).isEqualTo(dto.due.toInstant()) + Assertions.assertThat(bean.followUp).isEqualTo(dto.followUp.toInstant()) + } +} diff --git a/extension/core/src/test/kotlin/org/camunda/community/rest/impl/builder/DelegatingDeploymentBuilderTest.kt b/extension/core/src/test/kotlin/org/camunda/community/rest/impl/builder/DelegatingDeploymentBuilderTest.kt index 81eca786..1c932056 100644 --- a/extension/core/src/test/kotlin/org/camunda/community/rest/impl/builder/DelegatingDeploymentBuilderTest.kt +++ b/extension/core/src/test/kotlin/org/camunda/community/rest/impl/builder/DelegatingDeploymentBuilderTest.kt @@ -2,20 +2,26 @@ package org.camunda.community.rest.impl.builder import org.assertj.core.api.Assertions.assertThat import org.camunda.bpm.model.bpmn.Bpmn +import org.camunda.bpm.model.cmmn.Cmmn +import org.camunda.bpm.model.dmn.Dmn +import org.camunda.bpm.model.dmn.instance.Definitions +import org.camunda.bpm.model.xml.test.AbstractModelElementInstanceTest.modelInstance import org.camunda.community.rest.client.api.DeploymentApiClient +import org.camunda.community.rest.client.model.DeploymentDto import org.camunda.community.rest.client.model.DeploymentResourceDto import org.camunda.community.rest.client.model.DeploymentWithDefinitionsDto import org.camunda.community.rest.client.model.ProcessDefinitionDto import org.junit.Before import org.junit.Test import org.mockito.kotlin.any -import org.mockito.kotlin.eq import org.mockito.kotlin.mock import org.mockito.kotlin.whenever import org.springframework.core.io.Resource import org.springframework.http.ResponseEntity import java.io.ByteArrayInputStream import java.util.* +import java.util.zip.ZipInputStream + class DelegatingDeploymentBuilderTest { @@ -23,11 +29,11 @@ class DelegatingDeploymentBuilderTest { val builder = DelegatingDeploymentBuilder(deploymentApiClient). apply { - this.deploymentName = "deploymentName" - this.tenantId = "tenantId" - this.deploymentSource = "deploymentSource" - this.enableDuplicateFiltering = true - this.deployChangedOnly = true + this.name("deploymentName") + this.tenantId("tenantId") + this.source("deploymentSource") + this.enableDuplicateFiltering() + this.enableDuplicateFiltering(true) this.activateProcessDefinitionsOn(Date()) this.addClasspathResource("test-resource.txt") this.addString("stringResource", "unusedText") @@ -37,7 +43,10 @@ class DelegatingDeploymentBuilderTest { @Before fun setup() { whenever(deploymentApiClient.getDeploymentResources("anotherDeploymentId")).thenReturn( - ResponseEntity.ok(listOf(DeploymentResourceDto().id("resourceId").name("name"))) + ResponseEntity.ok(listOf(DeploymentResourceDto().id("resourceId").name("resourceName"))) + ) + whenever(deploymentApiClient.getDeployment("anotherDeploymentId")).thenReturn( + ResponseEntity.ok(DeploymentDto().id("deploymentId").name("deploymentName")) ) whenever(deploymentApiClient.getDeploymentResource("anotherDeploymentId", "resourceId")).thenReturn( ResponseEntity.ok(DeploymentResourceDto().name("resourceName")) @@ -48,8 +57,26 @@ class DelegatingDeploymentBuilderTest { ) whenever(resourceMock.inputStream).thenReturn(ByteArrayInputStream("someResourceText".toByteArray())) builder.addDeploymentResources("anotherDeploymentId") + builder.addDeploymentResourcesByName("anotherDeploymentId", listOf("resourceName")) + builder.addDeploymentResourceByName("anotherDeploymentId", "resourceName") val model = Bpmn.createExecutableProcess().id("test").startEvent().endEvent() builder.addModelInstance("modelInstance", model.done()) + val dmnModel = Dmn.createEmptyModel() + val definitions = dmnModel.newInstance(Definitions::class.java) + definitions.namespace = "http://camunda.org/schema/1.0/dmn" + definitions.name = "definitions" + definitions.id = "definitions" + dmnModel.definitions = definitions + builder.addModelInstance("dmnModel", dmnModel) + val cmmnModel = Cmmn.createEmptyModel() + val cmmnDefinitions = cmmnModel.newInstance(org.camunda.bpm.model.cmmn.instance.Definitions::class.java) + cmmnDefinitions.targetNamespace = "http://camunda.org/schema/1.0/cmmn" + cmmnDefinitions.name = "definitions" + cmmnDefinitions.id = "definitions" + cmmnModel.definitions = cmmnDefinitions + builder.addModelInstance("cmmnModel", cmmnModel) + builder.addZipInputStream(ZipInputStream(javaClass.classLoader.getResourceAsStream("test-resource.zip")!!)) + builder.nameFromDeployment("anotherDeploymentId") } @Test @@ -57,6 +84,8 @@ class DelegatingDeploymentBuilderTest { whenever(deploymentApiClient.createDeployment(any(), any(), any(), any(), any(), any(), any())).thenReturn( ResponseEntity.ok(DeploymentWithDefinitionsDto().name("name").id("id")) ) + val names = builder.resourceNames + assertThat(names).isNotEmpty() val result = builder.deploy() assertThat(result).isNotNull assertThat(result.id).isEqualTo("id") diff --git a/extension/core/src/test/kotlin/org/camunda/community/rest/impl/builder/RemoteExternalTaskQueryBuilderTest.kt b/extension/core/src/test/kotlin/org/camunda/community/rest/impl/builder/RemoteExternalTaskQueryBuilderTest.kt index f4c45c1f..50b4b675 100644 --- a/extension/core/src/test/kotlin/org/camunda/community/rest/impl/builder/RemoteExternalTaskQueryBuilderTest.kt +++ b/extension/core/src/test/kotlin/org/camunda/community/rest/impl/builder/RemoteExternalTaskQueryBuilderTest.kt @@ -35,14 +35,22 @@ class RemoteExternalTaskQueryBuilderTest { .enableCustomObjectDeserialization() .includeExtensionProperties() .processDefinitionId("processDefinitionId") - .processInstanceVariableEquals("var", "value") .topic("topic2", 5000) + .withoutTenantId() .tenantIdIn("tenantId") .businessKey("businessKey") .enableCustomObjectDeserialization() .includeExtensionProperties() .processDefinitionId("processDefinitionId") + .processDefinitionIdIn("processDefinitionIn") + .processDefinitionKey("processDefinitionKey") + .processDefinitionKeyIn("processDefinitionKeyIn") + .processDefinitionVersionTag("processDefinitionVersionTag") .processInstanceVariableEquals("var", "value") + .processInstanceVariableEquals(mapOf("var" to "value")) + .variables("var") + .variables(listOf("var")) + .localVariables() .execute() assertThat(result).hasSize(1) } diff --git a/extension/core/src/test/kotlin/org/camunda/community/rest/impl/query/DelegatingExecutionQueryTest.kt b/extension/core/src/test/kotlin/org/camunda/community/rest/impl/query/DelegatingExecutionQueryTest.kt index 3b0b34ce..9a1a956b 100644 --- a/extension/core/src/test/kotlin/org/camunda/community/rest/impl/query/DelegatingExecutionQueryTest.kt +++ b/extension/core/src/test/kotlin/org/camunda/community/rest/impl/query/DelegatingExecutionQueryTest.kt @@ -35,7 +35,13 @@ class DelegatingExecutionQueryTest { this.matchVariableNamesIgnoreCase() this.matchVariableValuesIgnoreCase() this.variableValueLike("var", "value") + this.variableValueNotLike("var2", "value2") this.variableValueEquals("var2", "value2") + this.variableValueNotEquals("var2", "value2") + this.variableValueGreaterThan("var2", "value2") + this.variableValueGreaterThanOrEqual("var2", "value2") + this.variableValueLessThan("var2", "value2") + this.variableValueLessThanOrEqual("var2", "value2") this.orderByProcessDefinitionKey().asc() } diff --git a/extension/core/src/test/kotlin/org/camunda/community/rest/impl/query/DelegatingHistoricProcessInstanceQueryTest.kt b/extension/core/src/test/kotlin/org/camunda/community/rest/impl/query/DelegatingHistoricProcessInstanceQueryTest.kt index f38727bb..ec134969 100644 --- a/extension/core/src/test/kotlin/org/camunda/community/rest/impl/query/DelegatingHistoricProcessInstanceQueryTest.kt +++ b/extension/core/src/test/kotlin/org/camunda/community/rest/impl/query/DelegatingHistoricProcessInstanceQueryTest.kt @@ -50,6 +50,10 @@ class DelegatingHistoricProcessInstanceQueryTest { this.executedActivityBefore(Date()) this.executedJobAfter(Date()) this.executedJobBefore(Date()) + this.active() + this.suspended() + this.internallyTerminated() + this.externallyTerminated() this.processDefinitionKey("processDefinitionKey") this.processDefinitionKeyIn("processDefinitionKeys") this.processInstanceIds(mutableSetOf("processInstanceIds")) diff --git a/extension/core/src/test/kotlin/org/camunda/community/rest/impl/query/DelegatingTaskQueryTest.kt b/extension/core/src/test/kotlin/org/camunda/community/rest/impl/query/DelegatingTaskQueryTest.kt index c0ac61b9..5f807e45 100644 --- a/extension/core/src/test/kotlin/org/camunda/community/rest/impl/query/DelegatingTaskQueryTest.kt +++ b/extension/core/src/test/kotlin/org/camunda/community/rest/impl/query/DelegatingTaskQueryTest.kt @@ -111,6 +111,27 @@ class DelegatingTaskQueryTest { this.matchVariableNamesIgnoreCase() this.matchVariableValuesIgnoreCase() this.variableValueEquals("var", "value") + this.taskVariableValueLike("taskVar", "value") + this.taskVariableValueEquals("taskVar", "value") + this.taskVariableValueNotEquals("taskVar", "value") + this.taskVariableValueLessThan("taskVar", "value") + this.taskVariableValueLessThanOrEquals("taskVar", "value") + this.taskVariableValueGreaterThan("taskVar", "value") + this.taskVariableValueGreaterThanOrEquals("taskVar", "value") + this.processVariableValueLike("processVar", "value") + this.processVariableValueEquals("processVar", "value") + this.processVariableValueNotEquals("processVar", "value") + this.processVariableValueLessThan("processVar", "value") + this.processVariableValueLessThanOrEquals("processVar", "value") + this.processVariableValueGreaterThan("processVar", "value") + this.processVariableValueGreaterThanOrEquals("processVar", "value") + this.caseInstanceVariableValueLike("caseVar", "value") + this.caseInstanceVariableValueEquals("caseVar", "value") + this.caseInstanceVariableValueNotEquals("caseVar", "value") + this.caseInstanceVariableValueLessThan("caseVar", "value") + this.caseInstanceVariableValueLessThanOrEquals("caseVar", "value") + this.caseInstanceVariableValueGreaterThan("caseVar", "value") + this.caseInstanceVariableValueGreaterThanOrEquals("caseVar", "value") this.orderByTaskName().asc() } diff --git a/extension/core/src/test/resources/test-resource.zip b/extension/core/src/test/resources/test-resource.zip new file mode 100644 index 0000000000000000000000000000000000000000..3aee5abf39adbfeda6b422a44344159f9e8bd27a GIT binary patch literal 148 zcmWIWW@Zs#00F;-mI$`q`e*?l8-xXcxFof>M7JolIKQ+gIaRNuq9iZBBqK8~T_H11 qAtSXYl`FuTkx7IBw*f#i7#KkW7+@F|;LXYgl3@fwdms(M3=9B0aU8Y) literal 0 HcmV?d00001