Search in sources :

Example 21 with DmnDecisionResult

use of org.camunda.bpm.dmn.engine.DmnDecisionResult in project camunda-bpm-platform by camunda.

the class MultiTenancyDecisionEvaluationTest method testEvaluateDecisionByKeyForAnyTenants.

public void testEvaluateDecisionByKeyForAnyTenants() {
    deploymentForTenant(TENANT_ONE, DMN_FILE);
    DmnDecisionResult decisionResult = decisionService.evaluateDecisionByKey(DECISION_DEFINITION_KEY).variables(createVariables()).evaluate();
    assertThatDecisionHasResult(decisionResult, RESULT_OF_FIRST_VERSION);
}
Also used : DmnDecisionResult(org.camunda.bpm.dmn.engine.DmnDecisionResult)

Example 22 with DmnDecisionResult

use of org.camunda.bpm.dmn.engine.DmnDecisionResult in project camunda-bpm-platform by camunda.

the class MultiTenancyDecisionEvaluationTest method testEvaluateDecisionByKeyAndTenantId.

public void testEvaluateDecisionByKeyAndTenantId() {
    deploymentForTenant(TENANT_ONE, DMN_FILE);
    deploymentForTenant(TENANT_TWO, DMN_FILE_SECOND_VERSION);
    DmnDecisionResult decisionResult = decisionService.evaluateDecisionByKey(DECISION_DEFINITION_KEY).variables(createVariables()).decisionDefinitionTenantId(TENANT_ONE).evaluate();
    assertThatDecisionHasResult(decisionResult, RESULT_OF_FIRST_VERSION);
}
Also used : DmnDecisionResult(org.camunda.bpm.dmn.engine.DmnDecisionResult)

Example 23 with DmnDecisionResult

use of org.camunda.bpm.dmn.engine.DmnDecisionResult in project camunda-bpm-platform by camunda.

the class MultiTenancyDecisionEvaluationTest method testEvaluateDecisionByKeyWithAuthenticatedTenant.

public void testEvaluateDecisionByKeyWithAuthenticatedTenant() {
    identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));
    deploymentForTenant(TENANT_ONE, DMN_FILE);
    deploymentForTenant(TENANT_TWO, DMN_FILE_SECOND_VERSION);
    DmnDecisionResult decisionResult = decisionService.evaluateDecisionByKey(DECISION_DEFINITION_KEY).variables(createVariables()).evaluate();
    assertThatDecisionHasResult(decisionResult, RESULT_OF_FIRST_VERSION);
}
Also used : DmnDecisionResult(org.camunda.bpm.dmn.engine.DmnDecisionResult)

Example 24 with DmnDecisionResult

use of org.camunda.bpm.dmn.engine.DmnDecisionResult in project camunda-bpm-platform by camunda.

the class MultiTenancyDecisionEvaluationTest method testEvaluateDecisionByKeyLatestVersionAndTenantId.

public void testEvaluateDecisionByKeyLatestVersionAndTenantId() {
    deploymentForTenant(TENANT_ONE, DMN_FILE);
    deploymentForTenant(TENANT_ONE, DMN_FILE_SECOND_VERSION);
    DmnDecisionResult decisionResult = decisionService.evaluateDecisionByKey(DECISION_DEFINITION_KEY).variables(createVariables()).decisionDefinitionTenantId(TENANT_ONE).evaluate();
    assertThatDecisionHasResult(decisionResult, RESULT_OF_SECOND_VERSION);
}
Also used : DmnDecisionResult(org.camunda.bpm.dmn.engine.DmnDecisionResult)

Example 25 with DmnDecisionResult

use of org.camunda.bpm.dmn.engine.DmnDecisionResult in project camunda-bpm-platform by camunda.

the class MultiTenancyDecisionEvaluationTest method testEvaluateDecisionByIdAuthenticatedTenant.

public void testEvaluateDecisionByIdAuthenticatedTenant() {
    deploymentForTenant(TENANT_ONE, DMN_FILE);
    DecisionDefinition decisionDefinition = repositoryService.createDecisionDefinitionQuery().singleResult();
    identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));
    DmnDecisionResult decisionResult = decisionService.evaluateDecisionById(decisionDefinition.getId()).variables(createVariables()).evaluate();
    assertThatDecisionHasResult(decisionResult, RESULT_OF_FIRST_VERSION);
}
Also used : DmnDecisionResult(org.camunda.bpm.dmn.engine.DmnDecisionResult) DecisionDefinition(org.camunda.bpm.engine.repository.DecisionDefinition)

Aggregations

DmnDecisionResult (org.camunda.bpm.dmn.engine.DmnDecisionResult)54 Test (org.junit.Test)40 DmnEngineTest (org.camunda.bpm.dmn.engine.test.DmnEngineTest)29 DecisionResource (org.camunda.bpm.dmn.engine.test.DecisionResource)25 HashMap (java.util.HashMap)6 Matchers.containsString (org.hamcrest.Matchers.containsString)6 Matchers.anyString (org.mockito.Matchers.anyString)6 Deployment (org.camunda.bpm.engine.test.Deployment)5 DmnDecisionResultEntries (org.camunda.bpm.dmn.engine.DmnDecisionResultEntries)4 DecisionDefinition (org.camunda.bpm.engine.repository.DecisionDefinition)4 VariableContext (org.camunda.bpm.engine.variable.context.VariableContext)4 TypedValue (org.camunda.bpm.engine.variable.value.TypedValue)4 DmnEngine (org.camunda.bpm.dmn.engine.DmnEngine)3 DefaultDmnEngineConfiguration (org.camunda.bpm.dmn.engine.impl.DefaultDmnEngineConfiguration)3 MockDecisionResultBuilder (org.camunda.bpm.engine.rest.helper.MockDecisionResultBuilder)3 DmnDecisionRequirementsGraph (org.camunda.bpm.dmn.engine.DmnDecisionRequirementsGraph)2 DmnDecisionResultException (org.camunda.bpm.dmn.engine.impl.DmnDecisionResultException)2 ArrayList (java.util.ArrayList)1 Map (java.util.Map)1 DmnDecision (org.camunda.bpm.dmn.engine.DmnDecision)1