use of org.camunda.bpm.engine.history.HistoricIdentityLinkLog in project camunda-bpm-platform by camunda.
the class HistoricIdentityLinkLogTestByXml method testShouldAddTaskCandidateGroupforAddIdentityLinkUsingXml.
@Deployment(resources = { "org/camunda/bpm/engine/test/api/runtime/OneTaskProcessWithCandidateGroups.bpmn20.xml" })
public void testShouldAddTaskCandidateGroupforAddIdentityLinkUsingXml() {
// Pre test
List<HistoricIdentityLinkLog> historicIdentityLinks = historyService.createHistoricIdentityLinkLogQuery().list();
assertEquals(historicIdentityLinks.size(), 0);
// given
startProcessInstance(PROCESS_DEFINITION_KEY_CANDIDATE_GROUP);
historicIdentityLinks = historyService.createHistoricIdentityLinkLogQuery().list();
assertEquals(historicIdentityLinks.size(), 1);
// query Test
HistoricIdentityLinkLogQuery query = historyService.createHistoricIdentityLinkLogQuery();
assertEquals(query.groupId(XML_GROUP).count(), 1);
}
use of org.camunda.bpm.engine.history.HistoricIdentityLinkLog in project camunda-bpm-platform by camunda.
the class HistoricIdentityLinkLogTestByXml method testShouldAddTaskAssigneeforAddIdentityLinkUsingXml.
@Deployment(resources = { "org/camunda/bpm/engine/test/api/runtime/OneTaskProcessWithTaskAssignee.bpmn20.xml" })
public void testShouldAddTaskAssigneeforAddIdentityLinkUsingXml() {
// Pre test
List<HistoricIdentityLinkLog> historicIdentityLinks = historyService.createHistoricIdentityLinkLogQuery().list();
assertEquals(historicIdentityLinks.size(), 0);
// given
startProcessInstance(PROCESS_DEFINITION_KEY_ASSIGNEE);
historicIdentityLinks = historyService.createHistoricIdentityLinkLogQuery().list();
assertEquals(historicIdentityLinks.size(), 1);
// query Test
HistoricIdentityLinkLogQuery query = historyService.createHistoricIdentityLinkLogQuery();
assertEquals(query.userId(XML_ASSIGNEE).count(), 1);
}
use of org.camunda.bpm.engine.history.HistoricIdentityLinkLog in project camunda-bpm-platform by camunda.
the class HistoricIdentityLinkLogTestByXml method testShouldAddProcessCandidateStarterUserforAddIdentityLinkUsingXml.
@Deployment(resources = { "org/camunda/bpm/engine/test/api/runtime/OneTaskProcessWithCandidateStarterUsers.bpmn20.xml" })
public void testShouldAddProcessCandidateStarterUserforAddIdentityLinkUsingXml() {
// Pre test - Historical identity link is added as part of deployment
List<HistoricIdentityLinkLog> historicIdentityLinks = historyService.createHistoricIdentityLinkLogQuery().list();
assertEquals(historicIdentityLinks.size(), 1);
// given
ProcessDefinition latestProcessDef = repositoryService.createProcessDefinitionQuery().processDefinitionKey(PROCESS_DEFINITION_KEY_CANDIDATE_STARTER_USER).singleResult();
assertNotNull(latestProcessDef);
List<IdentityLink> links = repositoryService.getIdentityLinksForProcessDefinition(latestProcessDef.getId());
assertEquals(1, links.size());
historicIdentityLinks = historyService.createHistoricIdentityLinkLogQuery().list();
assertEquals(historicIdentityLinks.size(), 1);
// query Test
HistoricIdentityLinkLogQuery query = historyService.createHistoricIdentityLinkLogQuery();
assertEquals(query.userId(XML_USER).count(), 1);
}
use of org.camunda.bpm.engine.history.HistoricIdentityLinkLog in project camunda-bpm-platform by camunda.
the class HistoricIdentityLinkLogTestByXml method testPropagateTenantIdToCandidateStarterGroup.
public void testPropagateTenantIdToCandidateStarterGroup() {
// when
org.camunda.bpm.engine.repository.Deployment deployment = repositoryService.createDeployment().addClasspathResource(CANDIDATE_STARTER_GROUP).tenantId(TENANT_ONE).deploy();
// then
List<HistoricIdentityLinkLog> historicLinks = historyService.createHistoricIdentityLinkLogQuery().list();
assertEquals(historicLinks.size(), 1);
HistoricIdentityLinkLog historicLink = historicLinks.get(0);
assertNotNull(historicLink.getTenantId());
assertEquals(TENANT_ONE, historicLink.getTenantId());
repositoryService.deleteDeployment(deployment.getId(), true);
}
use of org.camunda.bpm.engine.history.HistoricIdentityLinkLog in project camunda-bpm-platform by camunda.
the class HistoricIdentityLinkLogTest method testShouldAddTaskOwnerForAddandDeleteIdentityLink.
@Deployment(resources = { "org/camunda/bpm/engine/test/api/runtime/oneTaskProcess.bpmn20.xml" })
public void testShouldAddTaskOwnerForAddandDeleteIdentityLink() {
// Pre test
List<HistoricIdentityLinkLog> historicIdentityLinks = historyService.createHistoricIdentityLinkLogQuery().list();
assertEquals(historicIdentityLinks.size(), 0);
// given
startProcessInstance(PROCESS_DEFINITION_KEY);
String taskId = taskService.createTaskQuery().singleResult().getId();
// if
addAndDeleteUserWithAssigner(taskId, IdentityLinkType.OWNER);
// then
historicIdentityLinks = historyService.createHistoricIdentityLinkLogQuery().list();
assertEquals(historicIdentityLinks.size(), 2);
// Basic Query test
HistoricIdentityLinkLogQuery query = historyService.createHistoricIdentityLinkLogQuery();
assertEquals(query.type(IdentityLinkType.OWNER).count(), 2);
}
Aggregations