use of org.camunda.bpm.engine.variable.value.TypedValue in project camunda-engine-dmn by camunda.
the class DmnDecisionResultTest method testSingleOutputUntypedValue.
@Test
@DecisionResource(resource = RESULT_TEST_DMN)
public void testSingleOutputUntypedValue() {
DmnDecisionResult decisionResult = evaluateWithMatchingRules(SINGLE_OUTPUT_VALUE);
assertThat(decisionResult).hasSize(1);
DmnDecisionResultEntries ruleResult = decisionResult.getFirstResult();
TypedValue typedEntry = ruleResult.getEntryTyped("firstOutput");
assertThat(typedEntry).isEqualTo(Variables.untypedValue("singleValue"));
typedEntry = ruleResult.getEntryTyped("secondOutput");
assertThat(typedEntry).isNull();
typedEntry = ruleResult.getFirstEntryTyped();
assertThat(typedEntry).isEqualTo(Variables.untypedValue("singleValue"));
typedEntry = ruleResult.getSingleEntryTyped();
assertThat(typedEntry).isEqualTo(Variables.untypedValue("singleValue"));
}
use of org.camunda.bpm.engine.variable.value.TypedValue in project camunda-engine-dmn by camunda.
the class DmnDecisionTableResultTest method testSingleOutputUntypedValue.
@Test
@DecisionResource(resource = RESULT_TEST_DMN)
public void testSingleOutputUntypedValue() {
DmnDecisionTableResult decisionResult = evaluateWithMatchingRules(SINGLE_OUTPUT_VALUE);
assertThat(decisionResult).hasSize(1);
DmnDecisionRuleResult ruleResult = decisionResult.getFirstResult();
TypedValue typedEntry = ruleResult.getEntryTyped("firstOutput");
assertThat(typedEntry).isEqualTo(Variables.untypedValue("singleValue"));
typedEntry = ruleResult.getEntryTyped("secondOutput");
assertThat(typedEntry).isNull();
typedEntry = ruleResult.getFirstEntryTyped();
assertThat(typedEntry).isEqualTo(Variables.untypedValue("singleValue"));
typedEntry = ruleResult.getSingleEntryTyped();
assertThat(typedEntry).isEqualTo(Variables.untypedValue("singleValue"));
}
use of org.camunda.bpm.engine.variable.value.TypedValue in project camunda-engine-dmn by camunda.
the class DmnDecisionTableResultTest method testSingleOutputTypedValue.
@Test
@DecisionResource(resource = RESULT_TEST_WITH_TYPES_DMN)
public void testSingleOutputTypedValue() {
DmnDecisionTableResult decisionResult = evaluateWithMatchingRules(SINGLE_OUTPUT_VALUE);
assertThat(decisionResult).hasSize(1);
DmnDecisionRuleResult ruleResult = decisionResult.getFirstResult();
TypedValue typedValue = ruleResult.getEntryTyped("firstOutput");
assertThat(typedValue).isEqualTo(Variables.stringValue("singleValue"));
typedValue = ruleResult.getEntryTyped("secondOutput");
assertThat(typedValue).isNull();
typedValue = ruleResult.getFirstEntryTyped();
assertThat(typedValue).isEqualTo(Variables.stringValue("singleValue"));
typedValue = ruleResult.getSingleEntryTyped();
assertThat(typedValue).isEqualTo(Variables.stringValue("singleValue"));
}
use of org.camunda.bpm.engine.variable.value.TypedValue in project camunda-engine-dmn by camunda.
the class DmnDecisionRuleResultAssert method hasSingleEntryTyped.
public DmnDecisionRuleResultAssert hasSingleEntryTyped(TypedValue value) {
hasSize(1);
TypedValue actualValue = actual.getSingleEntryTyped();
failIfTypedValuesAreNotEqual(value, actualValue);
return this;
}
use of org.camunda.bpm.engine.variable.value.TypedValue in project camunda-engine-dmn by camunda.
the class DmnDataTypeTransformerTest method booleanType.
@Test
public void booleanType() {
DmnDataTypeTransformer typeTransformer = registry.getTransformer("boolean");
assertThat(typeTransformer.transform(true), is((TypedValue) Variables.booleanValue(true)));
assertThat(typeTransformer.transform(false), is((TypedValue) Variables.booleanValue(false)));
assertThat(typeTransformer.transform("true"), is((TypedValue) Variables.booleanValue(true)));
assertThat(typeTransformer.transform("false"), is((TypedValue) Variables.booleanValue(false)));
}
Aggregations