@Test
public void testRemoveActiveTask() {

    
    String activeNodeId = "_ECEDD1CE-7380-418C-B7A6-AF8ECB90B820";
    String nextNodeId = "_9EF3CAE0-D978-4E96-9C00-8A80082EB68E";
    
    createRuntimeManagers("migration/v1/RemoveActiveTask-v1.bpmn2", "migration/v2/RemoveActiveTask-v2.bpmn2");
    assertNotNull(managerV1);
    assertNotNull(managerV2);
    
    RuntimeEngine runtime = managerV1.getRuntimeEngine(EmptyContext.get());
    KieSession ksession = runtime.getKieSession();
    assertNotNull(ksession); 
    
    ProcessInstance pi1 = ksession.startProcess(REMOVEACTIVETASK_ID_V1);
    assertNotNull(pi1);
    assertEquals(ProcessInstance.STATE_ACTIVE, pi1.getState());        
    managerV1.disposeRuntimeEngine(runtime);
    
    MigrationSpec migrationSpec = new MigrationSpec(DEPLOYMENT_ID_V1, pi1.getId(), DEPLOYMENT_ID_V2, REMOVEACTIVETASK_ID_V2);        
    MigrationManager migrationManager = new MigrationManager(migrationSpec);
    MigrationReport report = migrationManager.migrate(Collections.singletonMap(activeNodeId, nextNodeId));        
    assertNotNull(report);
    assertTrue(report.isSuccessful());
    
    assertMigratedProcessInstance(REMOVEACTIVETASK_ID_V2, pi1.getId(), ProcessInstance.STATE_ACTIVE);
            
    runtime = managerV2.getRuntimeEngine(EmptyContext.get());
    TaskService taskService = runtime.getTaskService();        
    
    assertMigratedTaskAndComplete(taskService, REMOVEACTIVETASK_ID_V2, pi1.getId(), "Mapped Task");
    
    assertMigratedProcessInstance(REMOVEACTIVETASK_ID_V2, pi1.getId(), ProcessInstance.STATE_COMPLETED);
    
    managerV2.disposeRuntimeEngine(runtime);
}