Search in sources :

Example 1 with Pageable

use of org.activiti.api.runtime.shared.query.Pageable in project Activiti by Activiti.

the class ProcessRuntimeIT method should_OnlyProcessDefinitionsFromLatestVersionRetrieved.

@Test
public void should_OnlyProcessDefinitionsFromLatestVersionRetrieved() {
    Deployment deployment = processRuntime.selectLatestDeployment();
    Page<ProcessDefinition> processDefinitionPage = processRuntime.processDefinitions(PAGEABLE);
    assertThat(processDefinitionPage.getContent().stream().filter(c -> c.getKey().equals(SUPER_PROCESS))).extracting(ProcessDefinition::getAppVersion).containsOnly(deployment.getVersion().toString());
}
Also used : RuntimeService(org.activiti.engine.RuntimeService) BeforeEach(org.junit.jupiter.api.BeforeEach) Pageable(org.activiti.api.runtime.shared.query.Pageable) ProcessRuntimeImpl(org.activiti.runtime.api.impl.ProcessRuntimeImpl) Task(org.activiti.api.task.model.Task) APIVariableInstanceConverter(org.activiti.runtime.api.model.impl.APIVariableInstanceConverter) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) SecurityUtil(org.activiti.spring.boot.security.util.SecurityUtil) Autowired(org.springframework.beans.factory.annotation.Autowired) ProcessDefinition(org.activiti.api.process.model.ProcessDefinition) Mockito.spy(org.mockito.Mockito.spy) ProcessPayloadBuilder(org.activiti.api.process.model.builders.ProcessPayloadBuilder) Deployment(org.activiti.api.process.model.Deployment) ProcessRuntime(org.activiti.api.process.runtime.ProcessRuntime) RepositoryService(org.activiti.engine.RepositoryService) BigDecimal(java.math.BigDecimal) ProcessSecurityPoliciesManager(org.activiti.core.common.spring.security.policies.ProcessSecurityPoliciesManager) ProcessAdminRuntimeImpl(org.activiti.runtime.api.impl.ProcessAdminRuntimeImpl) SignalPayload(org.activiti.api.process.model.payloads.SignalPayload) ApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher) Assertions.catchThrowable(org.assertj.core.api.Assertions.catchThrowable) APIProcessInstanceConverter(org.activiti.runtime.api.model.impl.APIProcessInstanceConverter) TaskRuntime(org.activiti.api.task.runtime.TaskRuntime) APIProcessDefinitionConverter(org.activiti.runtime.api.model.impl.APIProcessDefinitionConverter) ProcessVariablesPayloadValidator(org.activiti.runtime.api.impl.ProcessVariablesPayloadValidator) ProcessInstance(org.activiti.api.process.model.ProcessInstance) ProcessRuntimeConfiguration(org.activiti.api.process.runtime.conf.ProcessRuntimeConfiguration) APIDeploymentConverter(org.activiti.runtime.api.model.impl.APIDeploymentConverter) TaskPayloadBuilder(org.activiti.api.task.model.builders.TaskPayloadBuilder) ActivitiIllegalArgumentException(org.activiti.engine.ActivitiIllegalArgumentException) UpdateProcessPayload(org.activiti.api.process.model.payloads.UpdateProcessPayload) Page(org.activiti.api.runtime.shared.query.Page) AccessDeniedException(org.springframework.security.access.AccessDeniedException) Collectors(java.util.stream.Collectors) Mockito.verify(org.mockito.Mockito.verify) Test(org.junit.jupiter.api.Test) StartProcessPayload(org.activiti.api.process.model.payloads.StartProcessPayload) List(java.util.List) AfterEach(org.junit.jupiter.api.AfterEach) RuntimeTestConfiguration(org.activiti.spring.boot.RuntimeTestConfiguration) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) ProcessCleanUpUtil(org.activiti.spring.boot.test.util.ProcessCleanUpUtil) ProcessAdminRuntime(org.activiti.api.process.runtime.ProcessAdminRuntime) VariableInstance(org.activiti.api.model.shared.model.VariableInstance) Tuple.tuple(org.assertj.core.groups.Tuple.tuple) Deployment(org.activiti.api.process.model.Deployment) ProcessDefinition(org.activiti.api.process.model.ProcessDefinition) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 2 with Pageable

use of org.activiti.api.runtime.shared.query.Pageable in project Activiti by Activiti.

the class ProcessRuntimeIT method should_processDefinitionAlwaysHaveAppVersion.

@Test
public void should_processDefinitionAlwaysHaveAppVersion() {
    Page<ProcessDefinition> processDefinitionPage = processRuntime.processDefinitions(PAGEABLE);
    assertThat(processDefinitionPage.getContent()).isNotEmpty();
    List<ProcessDefinition> processDefinitions = processDefinitionPage.getContent().stream().filter(c -> c.getKey().equals(SUPER_PROCESS)).collect(Collectors.toList());
    assertThat(processDefinitions).hasSize(1);
    ProcessDefinition result = processDefinitions.get(0);
    assertThat(result.getAppVersion()).isEqualTo("1");
}
Also used : RuntimeService(org.activiti.engine.RuntimeService) BeforeEach(org.junit.jupiter.api.BeforeEach) Pageable(org.activiti.api.runtime.shared.query.Pageable) ProcessRuntimeImpl(org.activiti.runtime.api.impl.ProcessRuntimeImpl) Task(org.activiti.api.task.model.Task) APIVariableInstanceConverter(org.activiti.runtime.api.model.impl.APIVariableInstanceConverter) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) SecurityUtil(org.activiti.spring.boot.security.util.SecurityUtil) Autowired(org.springframework.beans.factory.annotation.Autowired) ProcessDefinition(org.activiti.api.process.model.ProcessDefinition) Mockito.spy(org.mockito.Mockito.spy) ProcessPayloadBuilder(org.activiti.api.process.model.builders.ProcessPayloadBuilder) Deployment(org.activiti.api.process.model.Deployment) ProcessRuntime(org.activiti.api.process.runtime.ProcessRuntime) RepositoryService(org.activiti.engine.RepositoryService) BigDecimal(java.math.BigDecimal) ProcessSecurityPoliciesManager(org.activiti.core.common.spring.security.policies.ProcessSecurityPoliciesManager) ProcessAdminRuntimeImpl(org.activiti.runtime.api.impl.ProcessAdminRuntimeImpl) SignalPayload(org.activiti.api.process.model.payloads.SignalPayload) ApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher) Assertions.catchThrowable(org.assertj.core.api.Assertions.catchThrowable) APIProcessInstanceConverter(org.activiti.runtime.api.model.impl.APIProcessInstanceConverter) TaskRuntime(org.activiti.api.task.runtime.TaskRuntime) APIProcessDefinitionConverter(org.activiti.runtime.api.model.impl.APIProcessDefinitionConverter) ProcessVariablesPayloadValidator(org.activiti.runtime.api.impl.ProcessVariablesPayloadValidator) ProcessInstance(org.activiti.api.process.model.ProcessInstance) ProcessRuntimeConfiguration(org.activiti.api.process.runtime.conf.ProcessRuntimeConfiguration) APIDeploymentConverter(org.activiti.runtime.api.model.impl.APIDeploymentConverter) TaskPayloadBuilder(org.activiti.api.task.model.builders.TaskPayloadBuilder) ActivitiIllegalArgumentException(org.activiti.engine.ActivitiIllegalArgumentException) UpdateProcessPayload(org.activiti.api.process.model.payloads.UpdateProcessPayload) Page(org.activiti.api.runtime.shared.query.Page) AccessDeniedException(org.springframework.security.access.AccessDeniedException) Collectors(java.util.stream.Collectors) Mockito.verify(org.mockito.Mockito.verify) Test(org.junit.jupiter.api.Test) StartProcessPayload(org.activiti.api.process.model.payloads.StartProcessPayload) List(java.util.List) AfterEach(org.junit.jupiter.api.AfterEach) RuntimeTestConfiguration(org.activiti.spring.boot.RuntimeTestConfiguration) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) ProcessCleanUpUtil(org.activiti.spring.boot.test.util.ProcessCleanUpUtil) ProcessAdminRuntime(org.activiti.api.process.runtime.ProcessAdminRuntime) VariableInstance(org.activiti.api.model.shared.model.VariableInstance) Tuple.tuple(org.assertj.core.groups.Tuple.tuple) ProcessDefinition(org.activiti.api.process.model.ProcessDefinition) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

BigDecimal (java.math.BigDecimal)2 List (java.util.List)2 Collectors (java.util.stream.Collectors)2 VariableInstance (org.activiti.api.model.shared.model.VariableInstance)2 Deployment (org.activiti.api.process.model.Deployment)2 ProcessDefinition (org.activiti.api.process.model.ProcessDefinition)2 ProcessInstance (org.activiti.api.process.model.ProcessInstance)2 ProcessPayloadBuilder (org.activiti.api.process.model.builders.ProcessPayloadBuilder)2 SignalPayload (org.activiti.api.process.model.payloads.SignalPayload)2 StartProcessPayload (org.activiti.api.process.model.payloads.StartProcessPayload)2 UpdateProcessPayload (org.activiti.api.process.model.payloads.UpdateProcessPayload)2 ProcessAdminRuntime (org.activiti.api.process.runtime.ProcessAdminRuntime)2 ProcessRuntime (org.activiti.api.process.runtime.ProcessRuntime)2 ProcessRuntimeConfiguration (org.activiti.api.process.runtime.conf.ProcessRuntimeConfiguration)2 Page (org.activiti.api.runtime.shared.query.Page)2 Pageable (org.activiti.api.runtime.shared.query.Pageable)2 Task (org.activiti.api.task.model.Task)2 TaskPayloadBuilder (org.activiti.api.task.model.builders.TaskPayloadBuilder)2 TaskRuntime (org.activiti.api.task.runtime.TaskRuntime)2 ProcessSecurityPoliciesManager (org.activiti.core.common.spring.security.policies.ProcessSecurityPoliciesManager)2