migration.execute();
session.commit();
// Root project migrated
Component root = mapper.selectComponentByKey("org.struts:struts");
assertThat(root.getUuid()).isNotNull();
assertThat(root.getProjectUuid()).isEqualTo(root.getUuid());
assertThat(root.getModuleUuid()).isNull();
assertThat(root.getModuleUuidPath()).isNull();
// Module with a snapshot having no islast=true
Component module = mapper.selectComponentByKey("org.struts:struts-core");
assertThat(module.getUuid()).isNotNull();
assertThat(module.getProjectUuid()).isEqualTo(module.getUuid());
assertThat(module.getModuleUuid()).isNull();
assertThat(module.getModuleUuidPath()).isNull();
// File linked on a no more existing project
Component file = mapper.selectComponentByKey("org.struts:struts-core:src/org/struts/RequestContext.java");
assertThat(file.getUuid()).isNotNull();
assertThat(file.getProjectUuid()).isEqualTo(file.getUuid());
assertThat(file.getModuleUuid()).isNull();
assertThat(file.getModuleUuidPath()).isNull();
}