diff options
author | Belen Pruvost <belen.pruvost@sonarsource.com> | 2022-07-06 16:55:00 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2022-07-07 20:03:10 +0000 |
commit | f8b052dd328e5348266764edca80b87249896a5b (patch) | |
tree | 49827fb100d862f9208de1b0fd09476f905017af /server/sonar-db-dao/src | |
parent | 233c3c9320d8f22b75eb657dc58d7b1974f1478e (diff) | |
download | sonarqube-f8b052dd328e5348266764edca80b87249896a5b.tar.gz sonarqube-f8b052dd328e5348266764edca80b87249896a5b.zip |
[NO JIRA] Replace 'squid' with 'java'
Diffstat (limited to 'server/sonar-db-dao/src')
6 files changed, 17 insertions, 17 deletions
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 47496728415..8a27b67b73b 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 @@ -97,7 +97,7 @@ public class ActiveRuleKey implements Serializable, Comparable<ActiveRuleKey> { } /** - * Format is "qprofile:rule", for example "12345:squid:AvoidCycle" + * Format is "qprofile:rule", for example "12345:java:AvoidCycle" */ @Override public String toString() { diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/issue/IssueDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/issue/IssueDaoTest.java index 941a2b31b1d..dfc724861a9 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/issue/IssueDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/issue/IssueDaoTest.java @@ -612,7 +612,7 @@ public class IssueDaoTest { IssueDto dto = new IssueDto(); dto.setComponent(new ComponentDto().setDbKey("struts:Action").setUuid("component-uuid")); dto.setProject(new ComponentDto().setDbKey("struts").setUuid("project-uuid")); - dto.setRule(RuleTesting.newRule(RuleKey.of("squid", "S001")).setUuid("uuid-200")); + dto.setRule(RuleTesting.newRule(RuleKey.of("java", "S001")).setUuid("uuid-200")); dto.setKee(key); dto.setType(2); dto.setLine(500); diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/issue/IssueDtoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/issue/IssueDtoTest.java index 58c74d9bf62..cacc799d7a2 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/issue/IssueDtoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/issue/IssueDtoTest.java @@ -48,7 +48,7 @@ public class IssueDtoTest { .setKee("100") .setType(RuleType.VULNERABILITY) .setRuleUuid("rule-uuid-1") - .setRuleKey("squid", "AvoidCycle") + .setRuleKey("java", "AvoidCycle") .setLanguage("xoo") .setComponentKey("org.sonar.sample:Sample") .setComponentUuid("CDEF") @@ -72,7 +72,7 @@ public class IssueDtoTest { DefaultIssue issue = dto.toDefaultIssue(); assertThat(issue.key()).isEqualTo("100"); assertThat(issue.type()).isEqualTo(RuleType.VULNERABILITY); - assertThat(issue.ruleKey()).hasToString("squid:AvoidCycle"); + assertThat(issue.ruleKey()).hasToString("java:AvoidCycle"); assertThat(issue.language()).isEqualTo("xoo"); assertThat(issue.componentUuid()).isEqualTo("CDEF"); assertThat(issue.projectUuid()).isEqualTo("GHIJ"); @@ -100,13 +100,13 @@ public class IssueDtoTest { public void set_rule() { IssueDto dto = new IssueDto() .setKee("100") - .setRule(new RuleDto().setUuid("uuid-1").setRuleKey("AvoidCycle").setRepositoryKey("squid").setIsExternal(true)) + .setRule(new RuleDto().setUuid("uuid-1").setRuleKey("AvoidCycle").setRepositoryKey("java").setIsExternal(true)) .setLanguage("xoo"); assertThat(dto.getRuleUuid()).isEqualTo("uuid-1"); - assertThat(dto.getRuleRepo()).isEqualTo("squid"); + assertThat(dto.getRuleRepo()).isEqualTo("java"); assertThat(dto.getRule()).isEqualTo("AvoidCycle"); - assertThat(dto.getRuleKey()).hasToString("squid:AvoidCycle"); + assertThat(dto.getRuleKey()).hasToString("java:AvoidCycle"); assertThat(dto.getLanguage()).isEqualTo("xoo"); assertThat(dto.isExternal()).isTrue(); } diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/ActiveRuleKeyTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/ActiveRuleKeyTest.java index 809d2331c46..b217e50e712 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/ActiveRuleKeyTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/qualityprofile/ActiveRuleKeyTest.java @@ -40,12 +40,12 @@ public class ActiveRuleKeyTest { @Test public void rule_key_can_contain_colons() { - RuleKey ruleKey = RuleKey.of("squid", "Key:With:Some::Colons"); + RuleKey ruleKey = RuleKey.of("java", "Key:With:Some::Colons"); QProfileDto profile = newQualityProfileDto(); ActiveRuleKey key = ActiveRuleKey.of(profile, ruleKey); assertThat(key.getRuleProfileUuid()).isEqualTo(profile.getRulesProfileUuid()); assertThat(key.getRuleKey()).isSameAs(ruleKey); - assertThat(key.toString()).isEqualTo(profile.getRulesProfileUuid() + ":squid:Key:With:Some::Colons"); + assertThat(key.toString()).isEqualTo(profile.getRulesProfileUuid() + ":java:Key:With:Some::Colons"); } @Test diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleDaoTest.java index bea1f12db93..0405c7eaa55 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleDaoTest.java @@ -451,7 +451,7 @@ public class RuleDaoTest { .setDefRemediationFunction(DebtRemediationFunction.Type.LINEAR_OFFSET.toString()) .setDefRemediationGapMultiplier("5d") .setDefRemediationBaseEffort("10h") - .setGapDescription("squid.S115.effortToFix") + .setGapDescription("java.S115.effortToFix") .setSystemTags(newHashSet("systag1", "systag2")) .setSecurityStandards(newHashSet("owaspTop10:a1", "cwe:123")) .setType(RuleType.BUG) @@ -477,7 +477,7 @@ public class RuleDaoTest { assertThat(ruleDto.getDefRemediationFunction()).isEqualTo("LINEAR_OFFSET"); assertThat(ruleDto.getDefRemediationGapMultiplier()).isEqualTo("5d"); assertThat(ruleDto.getDefRemediationBaseEffort()).isEqualTo("10h"); - assertThat(ruleDto.getGapDescription()).isEqualTo("squid.S115.effortToFix"); + assertThat(ruleDto.getGapDescription()).isEqualTo("java.S115.effortToFix"); assertThat(ruleDto.getSystemTags()).containsOnly("systag1", "systag2"); assertThat(ruleDto.getSecurityStandards()).containsOnly("owaspTop10:a1", "cwe:123"); assertThat(ruleDto.getScope()).isEqualTo(Scope.ALL); @@ -511,7 +511,7 @@ public class RuleDaoTest { .setDefRemediationFunction(DebtRemediationFunction.Type.LINEAR_OFFSET.toString()) .setDefRemediationGapMultiplier("5d") .setDefRemediationBaseEffort("10h") - .setGapDescription("squid.S115.effortToFix") + .setGapDescription("java.S115.effortToFix") .setSystemTags(newHashSet("systag1", "systag2")) .setSecurityStandards(newHashSet("owaspTop10:a1", "cwe:123")) .setScope(Scope.ALL) @@ -536,7 +536,7 @@ public class RuleDaoTest { assertThat(ruleDto.getDefRemediationFunction()).isEqualTo("LINEAR_OFFSET"); assertThat(ruleDto.getDefRemediationGapMultiplier()).isEqualTo("5d"); assertThat(ruleDto.getDefRemediationBaseEffort()).isEqualTo("10h"); - assertThat(ruleDto.getGapDescription()).isEqualTo("squid.S115.effortToFix"); + assertThat(ruleDto.getGapDescription()).isEqualTo("java.S115.effortToFix"); assertThat(ruleDto.getSystemTags()).containsOnly("systag1", "systag2"); assertThat(ruleDto.getSecurityStandards()).containsOnly("owaspTop10:a1", "cwe:123"); assertThat(ruleDto.getScope()).isEqualTo(Scope.ALL); diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleRepositoryDaoTest.java b/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleRepositoryDaoTest.java index a71d67502d1..b75e26632cc 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleRepositoryDaoTest.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleRepositoryDaoTest.java @@ -126,24 +126,24 @@ public class RuleRepositoryDaoTest { public void selectByLanguage() { DbSession dbSession = dbTester.getSession(); RuleRepositoryDto dto1 = new RuleRepositoryDto("findbugs", "java", "Findbugs"); - RuleRepositoryDto dto2 = new RuleRepositoryDto("squid", "java", "Java"); + RuleRepositoryDto dto2 = new RuleRepositoryDto("java", "java", "Java"); RuleRepositoryDto dto3 = new RuleRepositoryDto("cobol-lint", "cobol", "Cobol Lint"); underTest.insert(dbSession, asList(dto1, dto2, dto3)); assertThat(underTest.selectByLanguage(dbSession, "java")).extracting(RuleRepositoryDto::getKey) // ordered by key - .containsExactly("findbugs", "squid"); + .containsExactly("findbugs", "java"); } @Test public void selectAllKeys() { DbSession dbSession = dbTester.getSession(); RuleRepositoryDto dto1 = new RuleRepositoryDto("findbugs", "java", "Findbugs"); - RuleRepositoryDto dto2 = new RuleRepositoryDto("squid", "java", "Java"); + RuleRepositoryDto dto2 = new RuleRepositoryDto("java", "java", "Java"); RuleRepositoryDto dto3 = new RuleRepositoryDto("cobol-lint", "cobol", "Cobol Lint"); underTest.insert(dbSession, asList(dto1, dto2, dto3)); - assertThat(underTest.selectAllKeys(dbSession)).containsOnly("findbugs", "squid", "cobol-lint"); + assertThat(underTest.selectAllKeys(dbSession)).containsOnly("findbugs", "java", "cobol-lint"); } @Test |