use of org.kie.server.api.model.cases.CaseFile in project droolsjbpm-integration by kiegroup.
the class CaseInstanceMigrationIntegrationTest method startCarInsuranceClaimCase.
private String startCarInsuranceClaimCase(String insured, String insuranceRep) {
CaseFile caseFile = CaseFile.builder().addUserAssignments(CASE_INSURED_ROLE, insured).addUserAssignments(CASE_INS_REP_ROLE, insuranceRep).addUserAssignments(CASE_INS_ASSESSOR_ROLE, insuranceRep).build();
String caseId = caseClient.startCase(CONTAINER_ID, CLAIM_CASE_DEF_ID, caseFile);
assertNotNull(caseId);
return caseId;
}
use of org.kie.server.api.model.cases.CaseFile in project droolsjbpm-integration by kiegroup.
the class CustomCaseIdIntegrationTest method testCustomCaseIdWithOptionalParams.
@Test
public void testCustomCaseIdWithOptionalParams() {
Assume.assumeFalse(TestConfig.isLocalServer());
Map<String, Object> data = new HashMap<>();
data.put("var1", "VALUE1");
data.put("country", "spa");
CaseFile caseFile = CaseFile.builder().addUserAssignments(CASE_OWNER_ROLE, USER_YODA).data(data).build();
String caseId = caseClient.startCase(CONTAINER_ID, PREFIX_VARIABLE_LOWER_CAPITALIZE, caseFile);
assertNotNull(caseId);
assertTrue("Created Case Id doesn't match expected value, value is: " + caseId, caseId.matches(CONTAINER_ID + "-value1-Spa-01234[0-9]+"));
}
use of org.kie.server.api.model.cases.CaseFile in project droolsjbpm-integration by kiegroup.
the class CustomCaseIdIntegrationTest method testCustomCaseIdWithoutParamsThrowsException.
@Test
public void testCustomCaseIdWithoutParamsThrowsException() {
Assume.assumeFalse(TestConfig.isLocalServer());
CaseFile caseFile = CaseFile.builder().addUserAssignments(CASE_OWNER_ROLE, USER_YODA).data(Collections.emptyMap()).build();
assertThatThrownBy(() -> caseClient.startCase(CONTAINER_ID, PREFIX_VARIABLE_LOWER_CAPITALIZE, caseFile)).isInstanceOf(KieServicesException.class).hasMessageContaining("Case Id Prefix cannot be generated");
}
Aggregations