diff options
author | Jacek <jacek.poreda@sonarsource.com> | 2020-04-24 11:46:24 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2020-05-25 20:05:20 +0000 |
commit | 94711e1ee7271e44e2061c3a2916ebb77aa4c956 (patch) | |
tree | 71b22ba9fb88de608f908343793d59b0c5c62cd7 /server/sonar-db-dao/src | |
parent | 6c334f9290e0a5f42b4b128919d4c25b5d20ce58 (diff) | |
download | sonarqube-94711e1ee7271e44e2061c3a2916ebb77aa4c956.tar.gz sonarqube-94711e1ee7271e44e2061c3a2916ebb77aa4c956.zip |
SONAR-13221 change PK to uuid of RULES_PROFILES table
* change profile_id to profile_uuid for ACTIVE_RULES
Diffstat (limited to 'server/sonar-db-dao/src')
15 files changed, 113 insertions, 148 deletions
diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/ActiveRuleDao.java b/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/ActiveRuleDao.java index bea2f1a725a..a5ef41393fe 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/ActiveRuleDao.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/ActiveRuleDao.java @@ -86,7 +86,7 @@ public class ActiveRuleDao implements Dao { } public List<ActiveRuleDto> selectByRuleProfile(DbSession dbSession, RulesProfileDto ruleProfileDto) { - return mapper(dbSession).selectByRuleProfileUuid(ruleProfileDto.getKee()); + return mapper(dbSession).selectByRuleProfileUuid(ruleProfileDto.getUuid()); } public Collection<ActiveRuleDto> selectByRulesAndRuleProfileUuids(DbSession dbSession, Collection<Integer> ruleIds, Collection<String> ruleProfileUuids) { @@ -98,7 +98,7 @@ public class ActiveRuleDao implements Dao { } public ActiveRuleDto insert(DbSession dbSession, ActiveRuleDto item) { - checkArgument(item.getProfileId() != null, QUALITY_PROFILE_IS_NOT_PERSISTED); + checkArgument(item.getProfileUuid() != null, QUALITY_PROFILE_IS_NOT_PERSISTED); checkArgument(item.getRuleId() != null, RULE_IS_NOT_PERSISTED); checkArgument(item.getUuid() == null, ACTIVE_RULE_IS_ALREADY_PERSISTED); @@ -108,7 +108,7 @@ public class ActiveRuleDao implements Dao { } public ActiveRuleDto update(DbSession dbSession, ActiveRuleDto item) { - checkArgument(item.getProfileId() != null, QUALITY_PROFILE_IS_NOT_PERSISTED); + checkArgument(item.getProfileUuid() != null, QUALITY_PROFILE_IS_NOT_PERSISTED); checkArgument(item.getRuleId() != null, ActiveRuleDao.RULE_IS_NOT_PERSISTED); checkArgument(item.getUuid() != null, ACTIVE_RULE_IS_NOT_PERSISTED); mapper(dbSession).update(item); diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/ActiveRuleDto.java b/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/ActiveRuleDto.java index 6cc8c2efb22..21426eea525 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/ActiveRuleDto.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/ActiveRuleDto.java @@ -37,7 +37,7 @@ public class ActiveRuleDto { public static final String OVERRIDES = ActiveRule.OVERRIDES; private String uuid; - private Integer profileId; + private String profileUuid; private Integer ruleId; private Integer severity; private String inheritance; @@ -75,12 +75,12 @@ public class ActiveRuleDto { return this; } - public Integer getProfileId() { - return profileId; + public String getProfileUuid() { + return profileUuid; } - public ActiveRuleDto setProfileId(Integer profileId) { - this.profileId = profileId; + public ActiveRuleDto setProfileUuid(String profileUuid) { + this.profileUuid = profileUuid; return this; } @@ -157,10 +157,10 @@ public class ActiveRuleDto { } public static ActiveRuleDto createFor(QProfileDto profile, RuleDefinitionDto ruleDto) { - requireNonNull(profile.getId(), "Profile is not persisted"); + requireNonNull(profile.getRulesProfileUuid(), "Profile is not persisted"); requireNonNull(ruleDto.getId(), "Rule is not persisted"); ActiveRuleDto dto = new ActiveRuleDto(); - dto.setProfileId(profile.getId()); + dto.setProfileUuid(profile.getRulesProfileUuid()); dto.setRuleId(ruleDto.getId()); dto.setKey(ActiveRuleKey.of(profile, ruleDto.getKey())); return dto; diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/ActiveRuleKey.java b/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/ActiveRuleKey.java index ad47324cdf4..ce16fb53fbe 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/ActiveRuleKey.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/ActiveRuleKey.java @@ -45,7 +45,7 @@ public class ActiveRuleKey implements Serializable, Comparable<ActiveRuleKey> { } public static ActiveRuleKey of(RulesProfileDto rulesProfile, RuleKey ruleKey) { - return new ActiveRuleKey(rulesProfile.getKee(), ruleKey); + return new ActiveRuleKey(rulesProfile.getUuid(), ruleKey); } /** diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/OrgActiveRuleDto.java b/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/OrgActiveRuleDto.java index 25d428d10b4..59aacb3335a 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/OrgActiveRuleDto.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/OrgActiveRuleDto.java @@ -22,7 +22,7 @@ package org.sonar.db.qualityprofile; public class OrgActiveRuleDto extends ActiveRuleDto { private String organizationUuid; - private String profileUuid; + private String orgProfileUuid; public String getOrganizationUuid() { return organizationUuid; @@ -33,12 +33,12 @@ public class OrgActiveRuleDto extends ActiveRuleDto { return this; } - public String getProfileUuid() { - return profileUuid; + public String getOrgProfileUuid() { + return orgProfileUuid; } - public OrgActiveRuleDto setProfileUuid(String s) { - this.profileUuid = s; + public OrgActiveRuleDto setOrgProfileUuid(String s) { + this.orgProfileUuid = s; return this; } } diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/QProfileDto.java b/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/QProfileDto.java index 462023295d2..ff041a371f8 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/QProfileDto.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/QProfileDto.java @@ -30,7 +30,6 @@ import org.sonar.db.organization.OrganizationDto; */ public class QProfileDto { - private Integer id; /** * The organization, that this quality profile belongs to. * Must not be null, but can be the default organization's uuid. @@ -74,15 +73,6 @@ public class QProfileDto { return this; } - public Integer getId() { - return id; - } - - public QProfileDto setId(Integer id) { - this.id = id; - return this; - } - public String getName() { return name; } @@ -160,8 +150,7 @@ public class QProfileDto { .setKee(org.getUuid()) .setParentKee(org.getParentUuid()) .setOrganizationUuid(org.getOrganizationUuid()) - .setId(rules.getId()) - .setRulesProfileUuid(rules.getKee()) + .setRulesProfileUuid(rules.getUuid()) .setLanguage(rules.getLanguage()) .setName(rules.getName()) .setRulesUpdatedAt(rules.getRulesUpdatedAt()) diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/QualityProfileDao.java b/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/QualityProfileDao.java index af0525ae5d4..1c7c77b3e3b 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/QualityProfileDao.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/QualityProfileDao.java @@ -39,7 +39,6 @@ import org.sonar.db.RowNotFoundException; import org.sonar.db.organization.OrganizationDto; import org.sonar.db.project.ProjectDto; -import static com.google.common.base.Preconditions.checkArgument; import static java.util.Collections.emptyList; import static org.sonar.db.DatabaseUtils.executeLargeInputs; import static org.sonar.db.DatabaseUtils.executeLargeUpdates; @@ -107,12 +106,10 @@ public class QualityProfileDao implements Dao { } private void doInsert(QualityProfileMapper mapper, QProfileDto profile) { - checkArgument(profile.getId() == null, "Quality profile is already persisted (got id %d)", profile.getId()); long now = system.now(); RulesProfileDto rulesProfile = RulesProfileDto.from(profile); mapper.insertRuleProfile(rulesProfile, new Date(now)); mapper.insertOrgQProfile(OrgQProfileDto.from(profile), now); - profile.setId(rulesProfile.getId()); } public void update(DbSession dbSession, QProfileDto profile, QProfileDto... otherProfiles) { @@ -264,7 +261,7 @@ public class QualityProfileDao implements Dao { } public List<QProfileDto> selectQProfilesByRuleProfile(DbSession dbSession, RulesProfileDto rulesProfile) { - return mapper(dbSession).selectQProfilesByRuleProfileUuid(rulesProfile.getKee()); + return mapper(dbSession).selectQProfilesByRuleProfileUuid(rulesProfile.getUuid()); } private static String sqlQueryString(@Nullable String query) { diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/RulesProfileDto.java b/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/RulesProfileDto.java index ad26e66cfda..415532e0a58 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/RulesProfileDto.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/qualityprofile/RulesProfileDto.java @@ -35,14 +35,9 @@ import org.sonar.core.util.UtcDateUtils; public class RulesProfileDto { /** - * Legacy db-generated ID. Usages should be replaced by {@link #kee}. + * UUID */ - private Integer id; - - /** - * UUID. Can be a unique slug on legacy rows, for example "abap-sonar-way-38370". - */ - private String kee; + private String uuid; /** * Name displayed to users, for example "Sonar way". Not null. @@ -67,21 +62,12 @@ public class RulesProfileDto { */ private boolean isBuiltIn; - public String getKee() { - return kee; - } - - public RulesProfileDto setKee(String s) { - this.kee = s; - return this; - } - - public Integer getId() { - return id; + public String getUuid() { + return uuid; } - public RulesProfileDto setId(Integer id) { - this.id = id; + public RulesProfileDto setUuid(String s) { + this.uuid = s; return this; } @@ -128,11 +114,10 @@ public class RulesProfileDto { public static RulesProfileDto from(QProfileDto qProfileDto) { return new RulesProfileDto() - .setKee(qProfileDto.getRulesProfileUuid()) + .setUuid(qProfileDto.getRulesProfileUuid()) .setLanguage(qProfileDto.getLanguage()) .setName(qProfileDto.getName()) .setIsBuiltIn(qProfileDto.isBuiltIn()) - .setId(qProfileDto.getId()) .setRulesUpdatedAt(qProfileDto.getRulesUpdatedAt()); } } diff --git a/server/sonar-db-dao/src/main/resources/org/sonar/db/qualityprofile/ActiveRuleMapper.xml b/server/sonar-db-dao/src/main/resources/org/sonar/db/qualityprofile/ActiveRuleMapper.xml index 26e013c0bfb..c40c83c6e51 100644 --- a/server/sonar-db-dao/src/main/resources/org/sonar/db/qualityprofile/ActiveRuleMapper.xml +++ b/server/sonar-db-dao/src/main/resources/org/sonar/db/qualityprofile/ActiveRuleMapper.xml @@ -5,42 +5,42 @@ <sql id="activeRuleColumns"> a.uuid, - a.profile_id as "profileId", + a.profile_uuid as "profileUuid", a.rule_id as "ruleId", a.failure_level as "severity", a.inheritance as "inheritance", r.plugin_rule_key as "rulefield", r.plugin_name as "repository", - rp.kee as "ruleProfileUuid", + rp.uuid as "ruleProfileUuid", a.created_at as "createdAt", a.updated_at as "updatedAt" </sql> <sql id="orgActiveRuleColumns"> a.uuid, - a.profile_id as "profileId", + a.profile_uuid as "profileUuid", a.rule_id as "ruleId", a.failure_level as "severity", a.inheritance as "inheritance", r.plugin_rule_key as "rulefield", r.plugin_name as "repository", r.security_standards as "securityStandards", - rp.kee as "ruleProfileUuid", + rp.uuid as "ruleProfileUuid", a.created_at as "createdAt", a.updated_at as "updatedAt", oqp.organization_uuid as "organizationUuid", - oqp.uuid as "profileUuid" + oqp.uuid as "orgProfileUuid" </sql> <sql id="activeRuleKeyJoin"> - inner join rules_profiles rp on rp.id = a.profile_id + inner join rules_profiles rp on rp.uuid = a.profile_uuid inner join rules r on r.id = a.rule_id </sql> <insert id="insert" parameterType="ActiveRule"> insert into active_rules ( uuid, - profile_id, + profile_uuid, rule_id, failure_level, inheritance, @@ -48,7 +48,7 @@ updated_at ) values ( #{uuid, jdbcType=VARCHAR}, - #{profileId, jdbcType=BIGINT}, + #{profileUuid, jdbcType=BIGINT}, #{ruleId, jdbcType=BIGINT}, #{severity, jdbcType=INTEGER}, #{inheritance, jdbcType=VARCHAR}, @@ -78,8 +78,8 @@ where exists ( select 1 from rules_profiles rp - where rp.id = profile_id - and rp.kee in + where rp.uuid = profile_uuid + and rp.uuid in <foreach collection="rulesProfileUuids" open="(" close=")" item="rulesProfileUuid" separator=",">#{rulesProfileUuid, jdbcType=VARCHAR}</foreach> ) </delete> @@ -97,7 +97,7 @@ from active_rules a <include refid="activeRuleKeyJoin"/> where - rp.kee = #{ruleProfileUuid, jdbcType=VARCHAR} + rp.uuid = #{ruleProfileUuid, jdbcType=VARCHAR} and r.plugin_rule_key = #{rule, jdbcType=VARCHAR} and r.plugin_name = #{repository, jdbcType=VARCHAR} </select> @@ -109,7 +109,7 @@ <include refid="activeRuleKeyJoin"/> where <foreach collection="keys" item="key" open="(" separator=" or " close=")"> - (rp.kee = #{key.ruleProfileUuid, jdbcType=VARCHAR} + (rp.uuid = #{key.ruleProfileUuid, jdbcType=VARCHAR} AND r.plugin_rule_key = #{key.ruleKey.rule, jdbcType=VARCHAR} AND r.plugin_name = #{key.ruleKey.repository, jdbcType=VARCHAR} ) @@ -120,8 +120,8 @@ select <include refid="orgActiveRuleColumns"/> from active_rules a - inner join rules_profiles rp on rp.id = a.profile_id - inner join org_qprofiles oqp on oqp.rules_profile_uuid = rp.kee + inner join rules_profiles rp on rp.uuid = a.profile_uuid + inner join org_qprofiles oqp on oqp.rules_profile_uuid = rp.uuid inner join rules r on r.id = a.rule_id and r.status != 'REMOVED' where oqp.uuid = #{id, jdbcType=VARCHAR} </select> @@ -130,8 +130,8 @@ select <include refid="orgActiveRuleColumns"/> from active_rules a - inner join rules_profiles rp on rp.id = a.profile_id - inner join org_qprofiles oqp on oqp.rules_profile_uuid = rp.kee + inner join rules_profiles rp on rp.uuid = a.profile_uuid + inner join org_qprofiles oqp on oqp.rules_profile_uuid = rp.uuid inner join rules r on r.id = a.rule_id and r.status != 'REMOVED' where r.rule_type in <foreach collection="types" item="type" separator="," open="(" close=")">#{type, jdbcType=INTEGER}</foreach> @@ -144,7 +144,7 @@ from active_rules a <include refid="activeRuleKeyJoin"/> where - rp.kee = #{ruleProfileUuid, jdbcType=VARCHAR} + rp.uuid = #{ruleProfileUuid, jdbcType=VARCHAR} </select> <select id="selectByRuleIdsAndRuleProfileUuids" parameterType="map" resultType="org.sonar.db.qualityprofile.ActiveRuleDto"> @@ -154,15 +154,15 @@ <include refid="activeRuleKeyJoin"/> where r.id in <foreach collection="ruleIds" item="ruleId" separator="," open="(" close=")">#{ruleId, jdbcType=BIGINT}</foreach> - and rp.kee in <foreach collection="ruleProfileUuids" item="ruleProfileUuid" separator="," open="(" close=")">#{ruleProfileUuid, jdbcType=VARCHAR}</foreach> + and rp.uuid in <foreach collection="ruleProfileUuids" item="ruleProfileUuid" separator="," open="(" close=")">#{ruleProfileUuid, jdbcType=VARCHAR}</foreach> </select> <select id="selectByRuleId" parameterType="map" resultType="org.sonar.db.qualityprofile.OrgActiveRuleDto"> select <include refid="orgActiveRuleColumns"/> from active_rules a - inner join rules_profiles rp on rp.id = a.profile_id - inner join org_qprofiles oqp on oqp.rules_profile_uuid = rp.kee + inner join rules_profiles rp on rp.uuid = a.profile_uuid + inner join org_qprofiles oqp on oqp.rules_profile_uuid = rp.uuid inner join rules r on r.id = a.rule_id where a.rule_id = #{ruleId, jdbcType=BIGINT} @@ -182,8 +182,8 @@ select <include refid="orgActiveRuleColumns"/> from active_rules a - inner join rules_profiles rp on rp.id = a.profile_id - inner join org_qprofiles oqp on oqp.rules_profile_uuid = rp.kee + inner join rules_profiles rp on rp.uuid = a.profile_uuid + inner join org_qprofiles oqp on oqp.rules_profile_uuid = rp.uuid inner join rules r on r.id = a.rule_id where a.rule_id in @@ -233,9 +233,9 @@ delete from active_rule_parameters where exists ( select 1 from active_rules ar - inner join rules_profiles rp on rp.id = ar.profile_id + inner join rules_profiles rp on rp.uuid = ar.profile_uuid where ar.uuid = active_rule_uuid - and rp.kee in + and rp.uuid in <foreach collection="rulesProfileUuids" open="(" close=")" item="rulesProfileUuid" separator=","> #{rulesProfileUuid, jdbcType=VARCHAR} </foreach> @@ -276,8 +276,8 @@ <select id="countActiveRulesByQuery" resultType="KeyLongValue" parameterType="map"> select oqp.uuid as "key", count(ar.uuid) as "value" from active_rules ar - inner join rules_profiles rp on rp.id = ar.profile_id - inner join org_qprofiles oqp on oqp.rules_profile_uuid = rp.kee + inner join rules_profiles rp on rp.uuid = ar.profile_uuid + inner join org_qprofiles oqp on oqp.rules_profile_uuid = rp.uuid inner join rules r on r.id = ar.rule_id <where> oqp.organization_uuid = #{organizationUuid, jdbcType=VARCHAR} @@ -311,7 +311,7 @@ <select id="scrollByRuleProfileUuidForIndexing" parameterType="String" resultType="org.sonar.db.qualityprofile.IndexedActiveRuleDto" fetchSize="${_scrollFetchSize}" resultSetType="FORWARD_ONLY"> <include refid="scrollAllForIndexingSql"/> - where rp.kee = #{ruleProfileUuid, jdbcType=VARCHAR} + where rp.uuid = #{ruleProfileUuid, jdbcType=VARCHAR} </select> <sql id="scrollAllForIndexingSql"> @@ -322,9 +322,9 @@ r.id as "ruleId", r.plugin_name as "repository", r.plugin_rule_key as "key", - rp.kee as "ruleProfileUuid" + rp.uuid as "ruleProfileUuid" from active_rules ar - inner join rules_profiles rp on rp.id = ar.profile_id + inner join rules_profiles rp on rp.uuid = ar.profile_uuid inner join rules r on r.id = ar.rule_id </sql> </mapper> diff --git a/server/sonar-db-dao/src/main/resources/org/sonar/db/qualityprofile/QProfileChangeMapper.xml b/server/sonar-db-dao/src/main/resources/org/sonar/db/qualityprofile/QProfileChangeMapper.xml index 53b284f6374..234fc6529fa 100644 --- a/server/sonar-db-dao/src/main/resources/org/sonar/db/qualityprofile/QProfileChangeMapper.xml +++ b/server/sonar-db-dao/src/main/resources/org/sonar/db/qualityprofile/QProfileChangeMapper.xml @@ -66,8 +66,8 @@ <sql id="sqlSelectByQuery"> from qprofile_changes qpc - inner join rules_profiles rp on rp.kee = qpc.rules_profile_uuid - inner join org_qprofiles oqp on oqp.rules_profile_uuid = rp.kee + inner join rules_profiles rp on rp.uuid = qpc.rules_profile_uuid + inner join org_qprofiles oqp on oqp.rules_profile_uuid = rp.uuid where oqp.uuid = #{query.profileUuid, jdbcType=VARCHAR} <if test="query.fromIncluded != null"> diff --git a/server/sonar-db-dao/src/main/resources/org/sonar/db/qualityprofile/QualityProfileExportMapper.xml b/server/sonar-db-dao/src/main/resources/org/sonar/db/qualityprofile/QualityProfileExportMapper.xml index 18f2256dfe6..36fdc79bec6 100644 --- a/server/sonar-db-dao/src/main/resources/org/sonar/db/qualityprofile/QualityProfileExportMapper.xml +++ b/server/sonar-db-dao/src/main/resources/org/sonar/db/qualityprofile/QualityProfileExportMapper.xml @@ -28,8 +28,8 @@ select <include refid="exportRuleColumns"/> from active_rules a - inner join rules_profiles rp on rp.id = a.profile_id - inner join org_qprofiles oqp on oqp.rules_profile_uuid = rp.kee + inner join rules_profiles rp on rp.uuid = a.profile_uuid + inner join org_qprofiles oqp on oqp.rules_profile_uuid = rp.uuid inner join rules r on r.id = a.rule_id and r.status != 'REMOVED' left join rules rt on rt.id = r.template_id left join rules_metadata rm on rm.rule_id = r.id diff --git a/server/sonar-db-dao/src/main/resources/org/sonar/db/qualityprofile/QualityProfileMapper.xml b/server/sonar-db-dao/src/main/resources/org/sonar/db/qualityprofile/QualityProfileMapper.xml index 1bd105d38cc..2afa6e164fd 100644 --- a/server/sonar-db-dao/src/main/resources/org/sonar/db/qualityprofile/QualityProfileMapper.xml +++ b/server/sonar-db-dao/src/main/resources/org/sonar/db/qualityprofile/QualityProfileMapper.xml @@ -9,8 +9,7 @@ oqp.parent_uuid as parentKee, oqp.last_used as lastUsed, oqp.user_updated_at as userUpdatedAt, - rp.id as id, - rp.kee as rulesProfileUuid, + rp.uuid as rulesProfileUuid, rp.name as name, rp.language as language, rp.rules_updated_at as rulesUpdatedAt, @@ -18,17 +17,16 @@ </sql> <sql id="ruleProfileColumns"> - rp.id as id, - rp.kee as kee, + rp.uuid as uuid, rp.name as name, rp.language as language, rp.rules_updated_at as rulesUpdatedAt, rp.is_built_in as isBuiltIn </sql> - <insert id="insertRuleProfile" parameterType="map" keyColumn="id" useGeneratedKeys="true" keyProperty="dto.id"> + <insert id="insertRuleProfile" parameterType="map" useGeneratedKeys="false"> insert into rules_profiles ( - kee, + uuid, name, language, created_at, @@ -36,7 +34,7 @@ rules_updated_at, is_built_in ) values ( - #{dto.kee, jdbcType=VARCHAR}, + #{dto.uuid, jdbcType=VARCHAR}, #{dto.name, jdbcType=VARCHAR}, #{dto.language, jdbcType=VARCHAR}, #{now, jdbcType=TIMESTAMP}, @@ -77,7 +75,7 @@ rules_updated_at = #{dto.rulesUpdatedAt, jdbcType=VARCHAR}, is_built_in = #{dto.isBuiltIn, jdbcType=BOOLEAN} where - kee = #{dto.kee, jdbcType=VARCHAR} + uuid = #{dto.uuid, jdbcType=VARCHAR} </update> <update id="updateOrgQProfile" parameterType="map"> @@ -103,7 +101,7 @@ <delete id="deleteRuleProfilesByUuids" parameterType="String"> delete from rules_profiles - where kee in + where uuid in <foreach collection="uuids" open="(" close=")" item="uuid" separator=",">#{uuid, jdbcType=VARCHAR}</foreach> </delete> @@ -122,14 +120,14 @@ <select id="selectRuleProfile" resultType="org.sonar.db.qualityprofile.RulesProfileDto"> select <include refid="ruleProfileColumns"/> from rules_profiles rp - where rp.kee = #{uuid, jdbcType=VARCHAR} + where rp.uuid = #{uuid, jdbcType=VARCHAR} </select> <select id="selectOrderedByOrganizationUuid" parameterType="map" resultType="org.sonar.db.qualityprofile.QProfileDto"> select <include refid="qProfileColumns"/> from org_qprofiles oqp - inner join rules_profiles rp on oqp.rules_profile_uuid = rp.kee + inner join rules_profiles rp on oqp.rules_profile_uuid = rp.uuid where oqp.organization_uuid = #{organizationUuid,jdbcType=VARCHAR} order by rp.name, rp.language @@ -139,7 +137,7 @@ select <include refid="qProfileColumns"/> from org_qprofiles oqp - inner join rules_profiles rp on oqp.rules_profile_uuid = rp.kee + inner join rules_profiles rp on oqp.rules_profile_uuid = rp.uuid inner join default_qprofiles dp on dp.qprofile_uuid = oqp.uuid where dp.language = #{language, jdbcType=VARCHAR} @@ -152,7 +150,7 @@ SELECT <include refid="qProfileColumns"/> FROM org_qprofiles oqp - INNER JOIN rules_profiles rp ON oqp.rules_profile_uuid = rp.kee + INNER JOIN rules_profiles rp ON oqp.rules_profile_uuid = rp.uuid INNER JOIN default_qprofiles dp ON dp.qprofile_uuid = oqp.uuid WHERE rp.is_built_in = ${_true} @@ -160,7 +158,7 @@ AND NOT EXISTS ( SELECT 1 FROM active_rules ar INNER JOIN rules r ON r.id = ar.rule_id AND r.status <> 'REMOVED' - WHERE profile_id=rp.id + WHERE profile_uuid = rp.uuid ) </select> @@ -168,7 +166,7 @@ select <include refid="qProfileColumns"/> from org_qprofiles oqp - inner join rules_profiles rp on oqp.rules_profile_uuid = rp.kee + inner join rules_profiles rp on oqp.rules_profile_uuid = rp.uuid inner join default_qprofiles dp on dp.qprofile_uuid = oqp.uuid where dp.language in <foreach collection="languages" open="(" close=")" item="language" separator=",">#{language, jdbcType=VARCHAR}</foreach> @@ -184,7 +182,7 @@ AND EXISTS ( SELECT 1 FROM active_rules ar INNER JOIN rules r ON r.id = ar.rule_id AND r.status <> 'REMOVED' - WHERE profile_id=rp.id + WHERE profile_uuid=rp.uuid ) </select> @@ -192,7 +190,7 @@ select <include refid="qProfileColumns"/> from org_qprofiles oqp - inner join rules_profiles rp on oqp.rules_profile_uuid = rp.kee + inner join rules_profiles rp on oqp.rules_profile_uuid = rp.uuid where rp.name = #{name, jdbcType=VARCHAR} and rp.language = #{language, jdbcType=VARCHAR} @@ -203,9 +201,9 @@ select <include refid="qProfileColumns"/> from org_qprofiles oqp - inner join rules_profiles rp on oqp.rules_profile_uuid = rp.kee + inner join rules_profiles rp on oqp.rules_profile_uuid = rp.uuid where - rp.kee = #{ruleProfileUuid, jdbcType=VARCHAR} + rp.uuid = #{ruleProfileUuid, jdbcType=VARCHAR} and oqp.organization_uuid = #{organizationUuid, jdbcType=VARCHAR} </select> @@ -213,7 +211,7 @@ select <include refid="qProfileColumns"/> from org_qprofiles oqp - inner join rules_profiles rp on oqp.rules_profile_uuid = rp.kee + inner join rules_profiles rp on oqp.rules_profile_uuid = rp.uuid where rp.name = #{name, jdbcType=VARCHAR} and rp.language in <foreach collection="languages" open="(" close=")" item="language" separator=",">#{language, jdbcType=VARCHAR}</foreach> @@ -224,7 +222,7 @@ select <include refid="qProfileColumns"/> from org_qprofiles oqp - inner join rules_profiles rp on oqp.rules_profile_uuid = rp.kee + inner join rules_profiles rp on oqp.rules_profile_uuid = rp.uuid where oqp.uuid = #{uuid, jdbcType=VARCHAR} </select> @@ -233,7 +231,7 @@ select <include refid="qProfileColumns"/> from org_qprofiles oqp - inner join rules_profiles rp on oqp.rules_profile_uuid = rp.kee + inner join rules_profiles rp on oqp.rules_profile_uuid = rp.uuid where oqp.uuid in <foreach collection="uuids" open="(" close=")" item="uuid" separator=",">#{uuid, jdbcType=VARCHAR}</foreach> </select> @@ -242,7 +240,7 @@ select <include refid="qProfileColumns"/> from org_qprofiles oqp - inner join rules_profiles rp on oqp.rules_profile_uuid = rp.kee + inner join rules_profiles rp on oqp.rules_profile_uuid = rp.uuid where rp.language = #{language, jdbcType=VARCHAR} and oqp.organization_uuid = #{organizationUuid, jdbcType=VARCHAR} @@ -252,7 +250,7 @@ <select id="selectChildren" parameterType="string" resultType="org.sonar.db.qualityprofile.QProfileDto"> select <include refid="qProfileColumns"/> from org_qprofiles oqp - inner join rules_profiles rp on oqp.rules_profile_uuid = rp.kee + inner join rules_profiles rp on oqp.rules_profile_uuid = rp.uuid inner join org_qprofiles parent on parent.uuid = oqp.parent_uuid where parent.uuid in <foreach collection="uuids" item="uuid" open="(" close=")" separator=",">#{uuid, jdbcType=VARCHAR}</foreach> @@ -278,7 +276,7 @@ select <include refid="qProfileColumns"/> from org_qprofiles oqp - inner join rules_profiles rp on oqp.rules_profile_uuid = rp.kee + inner join rules_profiles rp on oqp.rules_profile_uuid = rp.uuid inner join project_qprofiles pqp ON pqp.profile_key = oqp.uuid where rp.language = #{language, jdbcType=VARCHAR} @@ -290,7 +288,7 @@ select <include refid="qProfileColumns"/> from org_qprofiles oqp - inner join rules_profiles rp on oqp.rules_profile_uuid = rp.kee + inner join rules_profiles rp on oqp.rules_profile_uuid = rp.uuid inner join project_qprofiles pqp ON pqp.profile_key = oqp.uuid where rp.language in <foreach collection="languages" open="(" close=")" item="language" separator=",">#{language, jdbcType=VARCHAR}</foreach> @@ -378,7 +376,7 @@ select oqp.rules_profile_uuid from org_qprofiles oqp inner join organizations o on o.uuid = oqp.organization_uuid - inner join rules_profiles rp on rp.kee = oqp.rules_profile_uuid + inner join rules_profiles rp on rp.uuid = oqp.rules_profile_uuid where rp.language = #{language, jdbcType=VARCHAR} and rp.name = #{name, jdbcType=VARCHAR} @@ -391,16 +389,16 @@ name = #{newName, jdbcType=VARCHAR}, updated_at = #{updatedAt, jdbcType=TIMESTAMP} where - kee in <foreach collection="uuids" open="(" close=")" item="uuid" separator=",">#{uuid, jdbcType=VARCHAR}</foreach> + uuid in <foreach collection="uuids" open="(" close=")" item="uuid" separator=",">#{uuid, jdbcType=VARCHAR}</foreach> </update> <select id="selectQProfilesByRuleProfileUuid" parameterType="string" resultType="org.sonar.db.qualityprofile.QProfileDto"> select <include refid="qProfileColumns"/> from org_qprofiles oqp - inner join rules_profiles rp on oqp.rules_profile_uuid = rp.kee + inner join rules_profiles rp on oqp.rules_profile_uuid = rp.uuid where - rp.kee= #{rulesProfileUuid, jdbcType=VARCHAR} + rp.uuid= #{rulesProfileUuid, jdbcType=VARCHAR} </select> </mapper> diff --git a/server/sonar-db-dao/src/schema/schema-sq.ddl b/server/sonar-db-dao/src/schema/schema-sq.ddl index e30a39e2ce3..3df56d3fc64 100644 --- a/server/sonar-db-dao/src/schema/schema-sq.ddl +++ b/server/sonar-db-dao/src/schema/schema-sq.ddl @@ -24,16 +24,16 @@ ALTER TABLE "ACTIVE_RULE_PARAMETERS" ADD CONSTRAINT "PK_ACTIVE_RULE_PARAMETERS" CREATE INDEX "ARP_ACTIVE_RULE_UUID" ON "ACTIVE_RULE_PARAMETERS"("ACTIVE_RULE_UUID"); CREATE TABLE "ACTIVE_RULES"( - "PROFILE_ID" INTEGER NOT NULL, "RULE_ID" INTEGER NOT NULL, "FAILURE_LEVEL" INTEGER NOT NULL, "INHERITANCE" VARCHAR(10), "CREATED_AT" BIGINT, "UPDATED_AT" BIGINT, - "UUID" VARCHAR(40) NOT NULL + "UUID" VARCHAR(40) NOT NULL, + "PROFILE_UUID" VARCHAR(40) NOT NULL ); ALTER TABLE "ACTIVE_RULES" ADD CONSTRAINT "PK_ACTIVE_RULES" PRIMARY KEY("UUID"); -CREATE UNIQUE INDEX "UNIQ_PROFILE_RULE_IDS" ON "ACTIVE_RULES"("PROFILE_ID", "RULE_ID"); +CREATE UNIQUE INDEX "UNIQ_PROFILE_RULE_IDS" ON "ACTIVE_RULES"("PROFILE_UUID", "RULE_ID"); CREATE TABLE "ALM_APP_INSTALLS"( "UUID" VARCHAR(40) NOT NULL, @@ -863,17 +863,15 @@ CREATE INDEX "RULES_PARAMETERS_RULE_ID" ON "RULES_PARAMETERS"("RULE_ID"); CREATE UNIQUE INDEX "RULES_PARAMETERS_UNIQUE" ON "RULES_PARAMETERS"("RULE_ID", "NAME"); CREATE TABLE "RULES_PROFILES"( - "ID" INTEGER NOT NULL AUTO_INCREMENT (1,1), "NAME" VARCHAR(100) NOT NULL, "LANGUAGE" VARCHAR(20), - "KEE" VARCHAR(255) NOT NULL, "IS_BUILT_IN" BOOLEAN NOT NULL, "RULES_UPDATED_AT" VARCHAR(100), "CREATED_AT" TIMESTAMP, - "UPDATED_AT" TIMESTAMP + "UPDATED_AT" TIMESTAMP, + "UUID" VARCHAR(40) NOT NULL ); -ALTER TABLE "RULES_PROFILES" ADD CONSTRAINT "PK_RULES_PROFILES" PRIMARY KEY("ID"); -CREATE UNIQUE INDEX "UNIQ_QPROF_KEY" ON "RULES_PROFILES"("KEE"); +ALTER TABLE "RULES_PROFILES" ADD CONSTRAINT "PK_RULES_PROFILES" PRIMARY KEY("UUID"); CREATE TABLE "SNAPSHOTS"( "UUID" VARCHAR(50) NOT NULL, diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/ActiveRuleDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/ActiveRuleDaoTest.java index 738d46df976..bd561b4f3f5 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/ActiveRuleDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/ActiveRuleDaoTest.java @@ -147,8 +147,8 @@ public class ActiveRuleDaoTest { List<OrgActiveRuleDto> result = underTest.selectByProfile(dbSession, profile1); assertThat(result) .hasSize(2) - .extracting(OrgActiveRuleDto::getOrganizationUuid, OrgActiveRuleDto::getProfileUuid, OrgActiveRuleDto::getProfileId) - .containsOnly(tuple(organization.getUuid(), profile1.getKee(), profile1.getId())); + .extracting(OrgActiveRuleDto::getOrganizationUuid, OrgActiveRuleDto::getOrgProfileUuid, OrgActiveRuleDto::getProfileUuid) + .containsOnly(tuple(organization.getUuid(), profile1.getKee(), profile1.getRulesProfileUuid())); assertThat(underTest.selectByProfile(dbSession, profile2)).isEmpty(); } @@ -169,7 +169,7 @@ public class ActiveRuleDaoTest { underTest.insert(dbSession, activeRule1); assertThat(underTest.selectByTypeAndProfileUuids(dbSession, singletonList(RuleType.VULNERABILITY.getDbConstant()), singletonList(profile1.getKee()))) - .extracting(OrgActiveRuleDto::getProfileUuid, OrgActiveRuleDto::getOrganizationUuid, OrgActiveRuleDto::getRuleId) + .extracting(OrgActiveRuleDto::getOrgProfileUuid, OrgActiveRuleDto::getOrganizationUuid, OrgActiveRuleDto::getRuleId) .contains(tuple(profile1.getKee(), profile1.getOrganizationUuid(), rule1.getId())); } @@ -195,7 +195,7 @@ public class ActiveRuleDaoTest { underTest.selectByTypeAndProfileUuids(dbSession, singletonList(RuleType.VULNERABILITY.getDbConstant()), singletonList(profile1.getKee()))) - .extracting(OrgActiveRuleDto::getProfileUuid, OrgActiveRuleDto::getOrganizationUuid, OrgActiveRuleDto::getRuleId) + .extracting(OrgActiveRuleDto::getOrgProfileUuid, OrgActiveRuleDto::getOrganizationUuid, OrgActiveRuleDto::getRuleId) .contains(tuple(profile1.getKee(), profile1.getOrganizationUuid(), rule1.getId())); assertThat( @@ -215,8 +215,8 @@ public class ActiveRuleDaoTest { List<ActiveRuleDto> result = underTest.selectByRuleProfile(dbSession, RulesProfileDto.from(profile1)); assertThat(result) .hasSize(2) - .extracting(ActiveRuleDto::getProfileId, ActiveRuleDto::getRuleKey, ActiveRuleDto::getSeverityString) - .containsOnly(tuple(profile1.getId(), rule1.getKey(), BLOCKER), tuple(profile1.getId(), rule2.getKey(), MAJOR)); + .extracting(ActiveRuleDto::getProfileUuid, ActiveRuleDto::getRuleKey, ActiveRuleDto::getSeverityString) + .containsOnly(tuple(profile1.getRulesProfileUuid(), rule1.getKey(), BLOCKER), tuple(profile1.getRulesProfileUuid(), rule2.getKey(), MAJOR)); assertThat(underTest.selectByProfile(dbSession, profile2)).isEmpty(); } @@ -271,7 +271,7 @@ public class ActiveRuleDaoTest { assertThat(result.getUuid()).isEqualTo(activeRule.getUuid()); assertThat(result.getKey()).isEqualTo(ActiveRuleKey.of(profile1, rule1.getKey())); assertThat(result.getRuleId()).isEqualTo(rule1.getId()); - assertThat(result.getProfileId()).isEqualTo(profile1.getId()); + assertThat(result.getProfileUuid()).isEqualTo(profile1.getRulesProfileUuid()); assertThat(result.getSeverityString()).isEqualTo(BLOCKER); assertThat(result.getInheritance()).isEqualTo(INHERITED); assertThat(result.getCreatedAt()).isEqualTo(1000L); @@ -283,7 +283,7 @@ public class ActiveRuleDaoTest { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("Quality profile is not persisted (missing id)"); - underTest.insert(dbSession, createFor(profile1, rule1).setProfileId(null)); + underTest.insert(dbSession, createFor(profile1, rule1).setProfileUuid(null)); } @Test @@ -325,7 +325,7 @@ public class ActiveRuleDaoTest { assertThat(result.getUuid()).isEqualTo(activeRule.getUuid()); assertThat(result.getKey()).isEqualTo(ActiveRuleKey.of(profile1, rule1.getKey())); assertThat(result.getRuleId()).isEqualTo(rule1.getId()); - assertThat(result.getProfileId()).isEqualTo(profile1.getId()); + assertThat(result.getProfileUuid()).isEqualTo(profile1.getRulesProfileUuid()); assertThat(result.getSeverityString()).isEqualTo(MAJOR); assertThat(result.getInheritance()).isEqualTo(OVERRIDES); assertThat(result.getCreatedAt()).isEqualTo(1000L); @@ -337,7 +337,7 @@ public class ActiveRuleDaoTest { thrown.expect(IllegalArgumentException.class); thrown.expectMessage("Quality profile is not persisted (missing id)"); - underTest.update(dbSession, createFor(profile1, rule1).setUuid("uuid").setProfileId(null)); + underTest.update(dbSession, createFor(profile1, rule1).setUuid("uuid").setProfileUuid(null)); } @Test diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/QualityProfileDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/QualityProfileDaoTest.java index f8cf46c71d8..a8f3ecaba0b 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/QualityProfileDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/QualityProfileDaoTest.java @@ -96,7 +96,6 @@ public class QualityProfileDaoTest { QProfileDto reloaded = underTest.selectByUuid(dbSession, dto.getKee()); assertThat(reloaded.getKee()).isEqualTo(dto.getKee()); assertThat(reloaded.getRulesProfileUuid()).isEqualTo(dto.getRulesProfileUuid()); - assertThat(reloaded.getId()).isNotNull().isNotZero(); assertThat(reloaded.getLanguage()).isEqualTo(dto.getLanguage()); assertThat(reloaded.getName()).isEqualTo(dto.getName()); assertThat(reloaded.getLastUsed()).isEqualTo(dto.getLastUsed()); @@ -192,7 +191,7 @@ public class QualityProfileDaoTest { public void selectRuleProfile() { RulesProfileDto rp = insertRulesProfile(); - assertThat(underTest.selectRuleProfile(dbSession, rp.getKee()).getId()).isEqualTo(rp.getId()); + assertThat(underTest.selectRuleProfile(dbSession, rp.getUuid()).getName()).isEqualTo(rp.getName()); assertThat(underTest.selectRuleProfile(dbSession, "missing")).isNull(); } @@ -201,11 +200,11 @@ public class QualityProfileDaoTest { RulesProfileDto rp1 = insertRulesProfile(); RulesProfileDto rp2 = insertRulesProfile(); - underTest.deleteRulesProfilesByUuids(dbSession, asList(rp1.getKee())); + underTest.deleteRulesProfilesByUuids(dbSession, asList(rp1.getUuid())); - List<Map<String, Object>> uuids = db.select(dbSession, "select kee as \"uuid\" from rules_profiles"); + List<Map<String, Object>> uuids = db.select(dbSession, "select uuid as \"uuid\" from rules_profiles"); assertThat(uuids).hasSize(1); - assertThat(uuids.get(0).get("uuid")).isEqualTo(rp2.getKee()); + assertThat(uuids.get(0).get("uuid")).isEqualTo(rp2.getUuid()); } @Test @@ -230,7 +229,7 @@ public class QualityProfileDaoTest { RulesProfileDto dto = new RulesProfileDto() .setName(randomAlphanumeric(10)) .setLanguage(randomAlphanumeric(3)) - .setKee(Uuids.createFast()) + .setUuid(Uuids.createFast()) .setIsBuiltIn(false); db.getDbClient().qualityProfileDao().insert(dbSession, dto); return dto; @@ -283,7 +282,7 @@ public class QualityProfileDaoTest { QProfileDto reloaded = reloadeds.get(i - 1); QProfileDto original = sharedData.get(i - 1); - assertThat(reloaded.getId()).isEqualTo(original.getId()); + assertThat(reloaded.getRulesProfileUuid()).isEqualTo(original.getRulesProfileUuid()); assertThat(reloaded.getName()).isEqualTo(original.getName()); assertThat(reloaded.getKee()).isEqualTo(original.getKee()); assertThat(reloaded.getOrganizationUuid()).isEqualTo(original.getOrganizationUuid()); @@ -406,7 +405,6 @@ public class QualityProfileDaoTest { assertThat(results).hasSize(1); QProfileDto result = results.get(0); - assertThat(result.getId()).isEqualTo(profile.getId()); assertThat(result.getName()).isEqualTo(profile.getName()); assertThat(result.getKee()).isEqualTo(profile.getKee()); assertThat(result.getLanguage()).isEqualTo(profile.getLanguage()); @@ -879,10 +877,10 @@ public class QualityProfileDaoTest { OrganizationDto org2 = db.organizations().insert(); RulesProfileDto ruleProfile1 = QualityProfileTesting.newRuleProfileDto(); - OrgQProfileDto profile1InOrg1 = new OrgQProfileDto().setOrganizationUuid(org1.getUuid()).setRulesProfileUuid(ruleProfile1.getKee()).setUuid(Uuids.create()); - OrgQProfileDto profile1InOrg2 = new OrgQProfileDto().setOrganizationUuid(org2.getUuid()).setRulesProfileUuid(ruleProfile1.getKee()).setUuid(Uuids.create()); + OrgQProfileDto profile1InOrg1 = new OrgQProfileDto().setOrganizationUuid(org1.getUuid()).setRulesProfileUuid(ruleProfile1.getUuid()).setUuid(Uuids.create()); + OrgQProfileDto profile1InOrg2 = new OrgQProfileDto().setOrganizationUuid(org2.getUuid()).setRulesProfileUuid(ruleProfile1.getUuid()).setUuid(Uuids.create()); RulesProfileDto ruleProfile2 = QualityProfileTesting.newRuleProfileDto(); - OrgQProfileDto profile2InOrg1 = new OrgQProfileDto().setOrganizationUuid(org1.getUuid()).setRulesProfileUuid(ruleProfile2.getKee()).setUuid(Uuids.create()); + OrgQProfileDto profile2InOrg1 = new OrgQProfileDto().setOrganizationUuid(org1.getUuid()).setRulesProfileUuid(ruleProfile2.getUuid()).setUuid(Uuids.create()); db.getDbClient().qualityProfileDao().insert(db.getSession(), ruleProfile1); db.getDbClient().qualityProfileDao().insert(db.getSession(), profile1InOrg1); db.getDbClient().qualityProfileDao().insert(db.getSession(), profile1InOrg2); @@ -898,7 +896,7 @@ public class QualityProfileDaoTest { @Test public void selectQProfilesByRuleProfileUuid_returns_empty_list_if_rule_profile_does_not_exist() { - List<QProfileDto> result = db.getDbClient().qualityProfileDao().selectQProfilesByRuleProfile(db.getSession(), new RulesProfileDto().setKee("unknown")); + List<QProfileDto> result = db.getDbClient().qualityProfileDao().selectQProfilesByRuleProfile(db.getSession(), new RulesProfileDto().setUuid("unknown")); assertThat(result).isEmpty(); } diff --git a/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/qualityprofile/QualityProfileTesting.java b/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/qualityprofile/QualityProfileTesting.java index 80299a723af..2df3eef2984 100644 --- a/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/qualityprofile/QualityProfileTesting.java +++ b/server/sonar-db-dao/src/testFixtures/java/org/sonar/db/qualityprofile/QualityProfileTesting.java @@ -65,7 +65,7 @@ public class QualityProfileTesting { */ public static RulesProfileDto newRuleProfileDto(Consumer<RulesProfileDto>... populators) { RulesProfileDto dto = new RulesProfileDto() - .setKee("uuid" + randomAlphabetic(10)) + .setUuid("uuid" + randomAlphabetic(10)) .setName("name" + randomAlphabetic(10)) .setLanguage("lang" + randomAlphabetic(5)) .setIsBuiltIn(false); |