if (Scopes.isProject(parentResource)) {
model.setModuleUuid(parentResource.getUuid());
String parentModuleUuidPath = parentModel.getModuleUuidPath();
- model.setModuleUuidPath(parentModuleUuidPath != null ? parentModuleUuidPath + "." + parentModel.getUuid() : parentModel.getUuid());
+ model.setModuleUuidPath(StringUtils.isNotBlank(parentModuleUuidPath) ? parentModuleUuidPath + "." + parentModel.getUuid() : parentModel.getUuid());
} else {
model.setModuleUuid(parentModel.getModuleUuid());
String parentModuleUuidPath = parentModel.getModuleUuidPath();
- model.setModuleUuidPath(parentModuleUuidPath != null ? parentModuleUuidPath : parentModel.getUuid());
+ model.setModuleUuidPath(StringUtils.isNotBlank(parentModuleUuidPath) ? parentModuleUuidPath : parentModel.getUuid());
}
} else {
// Root module && libraries
model.setProjectUuid(model.getUuid());
+ model.setModuleUuidPath("");
}
}
assertThat(newProject.uuid()).isNotNull();
assertThat(newProject.projectUuid()).isEqualTo(newProject.uuid());
assertThat(newProject.moduleUuid()).isNull();
- assertThat(newProject.moduleUuidPath()).isNull();
+ assertThat(newProject.moduleUuidPath()).isEqualTo("");
// SONAR-3636 : created_at must be fed when inserting a new entry in the 'projects' table
assertThat(newProject.getCreatedAt()).isNotNull();
} finally {
assertThat(newProject.uuid()).isNotNull();
assertThat(newProject.projectUuid()).isEqualTo(newProject.uuid());
assertThat(newProject.moduleUuid()).isNull();
- assertThat(newProject.moduleUuidPath()).isNull();
+ assertThat(newProject.moduleUuidPath()).isEqualTo("");
} finally {
MyBatis.closeQuietly(session);
}
assertThat(root.uuid()).isNotNull();
assertThat(root.projectUuid()).isEqualTo(root.uuid());
assertThat(root.moduleUuid()).isNull();
- assertThat(root.moduleUuidPath()).isNull();
+ assertThat(root.moduleUuidPath()).isEqualTo("");
ComponentDto a = session.getMapper(ComponentMapper.class).selectByKey("a");
assertThat(a.uuid()).isNotNull();
assertThat(a.projectUuid()).isEqualTo(root.uuid());
assertThat(root.uuid()).isNotNull();
assertThat(root.projectUuid()).isEqualTo(root.uuid());
assertThat(root.moduleUuid()).isNull();
- assertThat(root.moduleUuidPath()).isNull();
+ assertThat(root.moduleUuidPath()).isEqualTo("");
ComponentDto a = session.getMapper(ComponentMapper.class).selectByKey("a");
System.out.println("A: " + a.uuid());
assertThat(a.uuid()).isNotNull();
assertThat(newLib.uuid()).isNotNull();
assertThat(newLib.projectUuid()).isEqualTo(newLib.uuid());
assertThat(newLib.moduleUuid()).isNull();
- assertThat(newLib.moduleUuidPath()).isNull();
+ assertThat(newLib.moduleUuidPath()).isEqualTo("");
} finally {
MyBatis.closeQuietly(session);
}