use of org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity in project camunda-bpm-platform by camunda.
the class HumanTaskDicretionaryItemHandlerTest method testWithParent.
@Test
public void testWithParent() {
// given:
// a new activity as parent
CmmnCaseDefinition parent = new CmmnCaseDefinition("aParentActivity");
context.setParent(parent);
// when
CmmnActivity activity = handler.handleElement(discretionaryItem, context);
// then
assertEquals(parent, activity.getParent());
assertTrue(parent.getActivities().contains(activity));
}
use of org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity in project camunda-bpm-platform by camunda.
the class HumanTaskDicretionaryItemHandlerTest method testDiscretionaryItemDescription.
@Test
public void testDiscretionaryItemDescription() {
// given
String description = "This is a discretionaryItem";
discretionaryItem.setDescription(description);
// when
CmmnActivity activity = handler.handleElement(discretionaryItem, context);
// then
assertEquals(description, activity.getProperty(PROPERTY_ACTIVITY_DESCRIPTION));
}
use of org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity in project camunda-bpm-platform by camunda.
the class HumanTaskDicretionaryItemHandlerTest method testHumanTaskActivityType.
@Test
public void testHumanTaskActivityType() {
// given
// when
CmmnActivity activity = handler.handleElement(discretionaryItem, context);
// then
String activityType = (String) activity.getProperty(PROPERTY_ACTIVITY_TYPE);
assertEquals("humanTask", activityType);
}
use of org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity in project camunda-bpm-platform by camunda.
the class HumanTaskDicretionaryItemHandlerTest method testRequiredRule.
@Test
public void testRequiredRule() {
// given
ItemControl itemControl = createElement(discretionaryItem, "ItemControl_1", ItemControl.class);
RequiredRule requiredRule = createElement(itemControl, "RequiredRule_1", RequiredRule.class);
ConditionExpression expression = createElement(requiredRule, "Expression_1", ConditionExpression.class);
expression.setText("${true}");
Cmmn.validateModel(modelInstance);
// when
CmmnActivity newActivity = handler.handleElement(discretionaryItem, context);
// then
Object rule = newActivity.getProperty(PROPERTY_REQUIRED_RULE);
assertNotNull(rule);
assertTrue(rule instanceof CaseControlRule);
}
use of org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity in project camunda-bpm-platform by camunda.
the class HumanTaskDicretionaryItemHandlerTest method testIsBlockingEqualsTrueProperty.
@Test
public void testIsBlockingEqualsTrueProperty() {
// given: a humanTask with isBlocking = true (defaultValue)
// when
CmmnActivity activity = handler.handleElement(discretionaryItem, context);
// then
Boolean isBlocking = (Boolean) activity.getProperty(PROPERTY_IS_BLOCKING);
assertTrue(isBlocking);
}
Aggregations