use of org.camunda.bpm.engine.variable.VariableMap in project camunda-bpm-platform by camunda.
the class TaskAuthorizationTest method testProcessTaskGetVariablesTypedByNameWithReadPermissionOnTask.
public void testProcessTaskGetVariablesTypedByNameWithReadPermissionOnTask() {
// given
startProcessInstanceByKey(PROCESS_KEY, getVariables());
String taskId = selectSingleTask().getId();
createGrantAuthorization(TASK, taskId, userId, READ);
// when
VariableMap variables = taskService.getVariablesTyped(taskId, Arrays.asList(VARIABLE_NAME), false);
// then
assertNotNull(variables);
assertFalse(variables.isEmpty());
assertEquals(1, variables.size());
assertEquals(VARIABLE_VALUE, variables.get(VARIABLE_NAME));
}
use of org.camunda.bpm.engine.variable.VariableMap in project camunda-bpm-platform by camunda.
the class TaskAuthorizationTest method testCaseTaskGetVariablesTypedByName.
// TaskService#getVariables() (case task) ////////////////////////////////////////////
public void testCaseTaskGetVariablesTypedByName() {
// given
createCaseInstanceByKey(CASE_KEY, getVariables());
String taskId = selectSingleTask().getId();
// when
VariableMap variables = taskService.getVariablesTyped(taskId, Arrays.asList(VARIABLE_NAME), false);
// then
assertNotNull(variables);
assertFalse(variables.isEmpty());
assertEquals(1, variables.size());
assertEquals(VARIABLE_VALUE, variables.get(VARIABLE_NAME));
}
use of org.camunda.bpm.engine.variable.VariableMap in project camunda-bpm-platform by camunda.
the class TaskAuthorizationTest method testStandaloneTaskGetVariablesTypedWithReadPermissionOnAnyTask.
public void testStandaloneTaskGetVariablesTypedWithReadPermissionOnAnyTask() {
// given
String taskId = "myTask";
createTask(taskId);
createGrantAuthorization(TASK, ANY, userId, READ);
disableAuthorization();
taskService.setVariables(taskId, getVariables());
enableAuthorization();
// when
VariableMap variables = taskService.getVariablesTyped(taskId);
// then
assertNotNull(variables);
assertFalse(variables.isEmpty());
assertEquals(1, variables.size());
assertEquals(VARIABLE_VALUE, variables.get(VARIABLE_NAME));
deleteTask(taskId, true);
}
use of org.camunda.bpm.engine.variable.VariableMap in project camunda-bpm-platform by camunda.
the class TaskAuthorizationTest method testProcessTaskGetVariablesTypedByNameWithReadTaskPermissionOnAnyProcessDefinition.
public void testProcessTaskGetVariablesTypedByNameWithReadTaskPermissionOnAnyProcessDefinition() {
// given
startProcessInstanceByKey(PROCESS_KEY, getVariables());
String taskId = selectSingleTask().getId();
createGrantAuthorization(PROCESS_DEFINITION, ANY, userId, READ_TASK);
// when
VariableMap variables = taskService.getVariablesTyped(taskId, Arrays.asList(VARIABLE_NAME), false);
// then
assertNotNull(variables);
assertFalse(variables.isEmpty());
assertEquals(1, variables.size());
assertEquals(VARIABLE_VALUE, variables.get(VARIABLE_NAME));
}
use of org.camunda.bpm.engine.variable.VariableMap in project camunda-bpm-platform by camunda.
the class ProcessInstanceAuthorizationTest method testGetVariablesLocalTypedByNameWithReadPermissionOnAnyProcessInstance.
public void testGetVariablesLocalTypedByNameWithReadPermissionOnAnyProcessInstance() {
// given
String processInstanceId = startProcessInstanceByKey(PROCESS_KEY, getVariables()).getId();
createGrantAuthorization(PROCESS_INSTANCE, ANY, userId, READ);
// when
VariableMap variables = runtimeService.getVariablesLocalTyped(processInstanceId, Arrays.asList(VARIABLE_NAME), false);
// then
assertNotNull(variables);
assertFalse(variables.isEmpty());
assertEquals(1, variables.size());
assertEquals(VARIABLE_VALUE, variables.get(VARIABLE_NAME));
}
Aggregations