@Test
public void testMigrateSingleCaseInstanceMissingMapping() {

    
    String caseId = createCaseInstanceV1();
    try {
        assertCaseInstance(caseId, deploymentUnitV1.getIdentifier(), CASE_DEF_ID_V1);
        
        Map<String, String> processMapping = new HashMap<>();
        final String caseIdFinal = caseId;
        assertThatExceptionOfType(RuntimeException.class).isThrownBy(() -> { 
            caseInstanceMigrationService.migrate(caseIdFinal, deploymentUnitV2.getIdentifier(), processMapping); })
        .withMessageContaining("Not possible to migrate case instance " + caseId+ " due to missing process mapping");
        
        
        assertCaseInstance(caseId, deploymentUnitV1.getIdentifier(), CASE_DEF_ID_V1);
        
        caseService.destroyCase(caseId);
        CaseInstance instance = caseService.getCaseInstance(caseId);
        Assertions.assertThat(instance.getStatus()).isEqualTo(CaseStatus.CANCELLED.getId());
        caseId = null;
    } catch (Exception e) {
        logger.error("Unexpected error {}", e.getMessage(), e);
        fail("Unexpected exception " + e.getMessage());
    } finally {
        if (caseId != null) {
            caseService.cancelCase(caseId);
        }
    }
}