use of org.kie.workbench.common.dmn.api.definition.model.Decision in project kie-wb-common by kiegroup.
the class QNameConverterTest method testToWidgetValueWhenDMNDiagramDoesNotDefinesNameSpaces.
@Test
public void testToWidgetValueWhenDMNDiagramDoesNotDefinesNameSpaces() {
converter.setDMNModel(new Decision());
final String encoding = converter.toWidgetValue(new QName(org.kie.dmn.model.v1_1.KieDMNModelInstrumentedBase.URI_DMN, "unknown", DMNModelInstrumentedBase.Namespace.DMN.getPrefix()));
assertEquals(ENCODED_DMN_UNKNOWN, encoding);
}
use of org.kie.workbench.common.dmn.api.definition.model.Decision in project kie-wb-common by kiegroup.
the class QNameConverterTest method testToWidgetValueWhenDMNDiagramDefinesNameSpaces.
@Test
public void testToWidgetValueWhenDMNDiagramDefinesNameSpaces() {
final Definitions definitions = new Definitions();
definitions.getNsContext().put(DMNModelInstrumentedBase.Namespace.FEEL.getPrefix(), DMNModelInstrumentedBase.Namespace.FEEL.getUri());
final Decision decision = new Decision();
decision.setParent(definitions);
converter.setDMNModel(decision);
final String encoding = converter.toWidgetValue(BuiltInType.DATE.asQName());
assertEquals(ENCODED_FEEL_DATE, encoding);
}
use of org.kie.workbench.common.dmn.api.definition.model.Decision in project kie-wb-common by kiegroup.
the class DMNElementsSynchronizerTest method testSynchronizeSpecializedProperties_DecisionNode.
@Test
public void testSynchronizeSpecializedProperties_DecisionNode() {
doNothing().when(synchronizer).synchronizeDecisionNode(any(Decision.class), any(Decision.class));
final Decision from = mock(Decision.class);
final Decision to = mock(Decision.class);
synchronizer.synchronizeSpecializedProperties(from, to);
verify(synchronizer).synchronizeDecisionNode(from, to);
}
use of org.kie.workbench.common.dmn.api.definition.model.Decision in project kie-wb-common by kiegroup.
the class DMNElementsSynchronizerTest method testUpdateText.
@Test
public void testUpdateText() {
final Decision from = mock(Decision.class);
final Node to = mock(Node.class);
final Name name = mock(Name.class);
final String nameValue = "the name";
when(name.getValue()).thenReturn(nameValue);
when(from.getName()).thenReturn(name);
synchronizer.updateText(from, to);
verify(nodeTextSetter).setText(nameValue, to);
}
use of org.kie.workbench.common.dmn.api.definition.model.Decision in project kie-wb-common by kiegroup.
the class DMNElementsSynchronizerTest method testSynchronizeDecisionNodeNode.
@Test
public void testSynchronizeDecisionNodeNode() {
final Decision from = mock(Decision.class);
final Decision to = mock(Decision.class);
final Question question = mock(Question.class);
final AllowedAnswers allowedAnswers = mock(AllowedAnswers.class);
final Expression expression = mock(Expression.class);
final InformationItemPrimary variable = mock(InformationItemPrimary.class);
when(from.getQuestion()).thenReturn(question);
when(from.getAllowedAnswers()).thenReturn(allowedAnswers);
when(from.getExpression()).thenReturn(expression);
when(from.getVariable()).thenReturn(variable);
synchronizer.synchronizeDecisionNode(from, to);
verify(to).setQuestion(question);
verify(to).setAllowedAnswers(allowedAnswers);
verify(to).setExpression(expression);
verify(to).setVariable(variable);
}
Aggregations