use of org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity in project camunda-bpm-platform by camunda.
the class MilestoneDiscretionaryItemHandlerTest method testActivityBehavior.
@Test
public void testActivityBehavior() {
// given: a planItem
// when
CmmnActivity activity = handler.handleElement(discretionaryItem, context);
// then
CmmnActivityBehavior behavior = activity.getActivityBehavior();
assertTrue(behavior instanceof MilestoneActivityBehavior);
}
use of org.camunda.bpm.engine.impl.cmmn.model.CmmnActivity in project camunda-bpm-platform by camunda.
the class MilestoneDiscretionaryItemHandlerTest method testMilestoneDescription.
@Test
public void testMilestoneDescription() {
// given
String description = "This is a milestone";
milestone.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 MilestoneDiscretionaryItemHandlerTest 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 MilestoneDiscretionaryItemHandlerTest 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 MilestoneDiscretionaryItemHandlerTest 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));
}
Aggregations