use of org.camunda.bpm.dmn.engine.impl.transform.DmnTransformException in project camunda-engine-dmn by camunda.
the class ParseDecisionTest method shouldFailIfDecisionDrgIdIsMissing.
@Test
public void shouldFailIfDecisionDrgIdIsMissing() {
try {
InputStream inputStream = IoUtil.fileAsStream(MISSING_DECISION_REQUIREMENT_DIAGRAM_ID_DMN);
dmnEngine.parseDecisionRequirementsGraph(inputStream);
failBecauseExceptionWasNotThrown(DmnTransformException.class);
} catch (DmnTransformException e) {
assertThat(e).hasCauseExactlyInstanceOf(DmnTransformException.class).hasMessageStartingWith("DMN-02016").hasMessageContaining("DMN-02017").hasMessageContaining("DRD with Missing Id");
}
}
use of org.camunda.bpm.dmn.engine.impl.transform.DmnTransformException in project camunda-engine-dmn by camunda.
the class DmnTransformTest method shouldDetectLoopInParseDecisionWithRequiredDecisionOfDifferentOrder.
@Test
public void shouldDetectLoopInParseDecisionWithRequiredDecisionOfDifferentOrder() {
InputStream inputStream = IoUtil.fileAsStream(LOOP_REQUIRED_DECISIONS_DIFFERENT_ORDER_DMN);
DmnModelInstance modelInstance = Dmn.readModelFromStream(inputStream);
try {
dmnEngine.parseDecisions(modelInstance);
failBecauseExceptionWasNotThrown(DmnTransformException.class);
} catch (DmnTransformException e) {
Assertions.assertThat(e).hasMessageStartingWith("DMN-02004").hasMessageContaining("DMN-02015").hasMessageContaining("has a loop");
}
}
use of org.camunda.bpm.dmn.engine.impl.transform.DmnTransformException in project camunda-engine-dmn by camunda.
the class DmnTransformTest method shouldDetectLoopInParseDecisionWithRequiredDecision.
@Test
public void shouldDetectLoopInParseDecisionWithRequiredDecision() {
InputStream inputStream = IoUtil.fileAsStream(LOOP_REQUIRED_DECISIONS_DMN);
DmnModelInstance modelInstance = Dmn.readModelFromStream(inputStream);
try {
decision = dmnEngine.parseDecision("buyProduct", modelInstance);
failBecauseExceptionWasNotThrown(DmnTransformException.class);
} catch (DmnTransformException e) {
Assertions.assertThat(e).hasMessageStartingWith("DMN-02004").hasMessageContaining("DMN-02015").hasMessageContaining("has a loop");
}
}
use of org.camunda.bpm.dmn.engine.impl.transform.DmnTransformException in project camunda-engine-dmn by camunda.
the class DmnTransformTest method shouldDetectLoopInParseDecisionWithSelfRequiredDecision.
@Test
public void shouldDetectLoopInParseDecisionWithSelfRequiredDecision() {
InputStream inputStream = IoUtil.fileAsStream(SELF_REQUIRED_DECISIONS_DMN);
DmnModelInstance modelInstance = Dmn.readModelFromStream(inputStream);
try {
decision = dmnEngine.parseDecision("buyProduct", modelInstance);
failBecauseExceptionWasNotThrown(DmnTransformException.class);
} catch (DmnTransformException e) {
Assertions.assertThat(e).hasMessageStartingWith("DMN-02004").hasMessageContaining("DMN-02015").hasMessageContaining("has a loop");
}
}
Aggregations