未验证 提交 f5e6b42b 编写于 作者: M Miguel Ruiz 提交者: GitHub

Activiti/Activiti#3765 Add Process Runtime coverage for category field (#3785)

* Activiti/Activiti#3765 Add Process Runtime coverage for category field

* Remove redundant null check

* Improve test

* Rearrage test code

* Improve test syntax
上级 298d664e
......@@ -24,6 +24,7 @@ import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import org.activiti.api.model.shared.model.VariableInstance;
import org.activiti.api.process.model.Deployment;
......@@ -75,6 +76,7 @@ public class ProcessRuntimeIT {
private static final String SUPER_PROCESS = "superProcess";
private static final Pageable PAGEABLE = Pageable.of(0,
50);
public static final String CATEGORIZE_HUMAN_PROCESS_CATEGORY = "test-category";
@Autowired
private ProcessRuntime processRuntime;
......@@ -186,6 +188,20 @@ public class ProcessRuntimeIT {
ONE_STEP_PROCESS);
}
@Test
public void should_allProcessDefinitionsHaveCategoriesSet_when_fetchingProcessDefinitions() {
//when
List<ProcessDefinition> processDefinitionList = processRuntime.processDefinitions(PAGEABLE)
.getContent();
//then
assertThat(processDefinitionList)
.extracting(ProcessDefinition::getCategory)
.contains(CATEGORIZE_HUMAN_PROCESS_CATEGORY)
.allMatch(Objects::nonNull);
}
@Test
public void shouldGetAvailableLatestDeployments() {
......
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_0v7t65f" targetNamespace="http://bpmn.io/schema/bpmn">
<bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_0v7t65f" targetNamespace="test-category">
<bpmn:process id="categorizeHumanProcess" name="categorizeHumanProcess" isExecutable="true">
<bpmn:startEvent id="StartEvent_1">
<bpmn:outgoing>SequenceFlow_14mnde3</bpmn:outgoing>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册