Skip to content

Commit

Permalink
SLCORE-1035 Handle rebranding labels for notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
nquinquenel committed Nov 12, 2024
1 parent ddb7cfb commit 88bb62e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
public class IssueService {

private static final String STATUS_CHANGE_PERMISSION_MISSING_REASON = "Marking an issue as resolved requires the 'Administer Issues' permission";
private static final String UNSUPPORTED_SQ_VERSION_REASON = "Marking a local-only issue as resolved requires SonarQube 10.2+";
private static final String UNSUPPORTED_SQ_VERSION_REASON = "Marking a local-only issue as resolved requires SonarQube Server 10.2+";
private static final Version SQ_ANTICIPATED_TRANSITIONS_MIN_VERSION = Version.create("10.2");

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public ProjectNotFoundException(String moduleKey, @Nullable String organizationK

private static String formatMessage(String moduleKey, @Nullable String organizationKey) {
if (organizationKey != null) {
return String.format("Project with key '%s' in organization '%s' not found on SonarCloud server (was it deleted?)", moduleKey, organizationKey);
return String.format("Project with key '%s' in organization '%s' not found on SonarQube Cloud (was it deleted?)", moduleKey, organizationKey);
}
return String.format("Project with key '%s' not found on SonarQube server (was it deleted?)", moduleKey);
return String.format("Project with key '%s' not found on SonarQube Server instance (was it deleted?)", moduleKey);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ class ProjectNotFoundExceptionTests {
@Test
void show_organization_key() {
var ex = new ProjectNotFoundException("module", "organization");
assertThat(ex.getMessage()).isEqualTo("Project with key 'module' in organization 'organization' not found on SonarCloud server (was it deleted?)");
assertThat(ex.getMessage()).isEqualTo("Project with key 'module' in organization 'organization' not found on SonarQube Cloud (was it deleted?)");
}

@Test
void organization_key_missing() {
var ex = new ProjectNotFoundException("module", null);
assertThat(ex.getMessage()).isEqualTo("Project with key 'module' not found on SonarQube server (was it deleted?)");
assertThat(ex.getMessage()).isEqualTo("Project with key 'module' not found on SonarQube Server instance (was it deleted?)");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private static void checkServerUpAndSupported(ServerStatusInfo serverStatus) {
}

private static String unsupportedVersion(ServerStatusInfo serverStatus) {
return "SonarQube server has version " + serverStatus.getVersion() + ". Version should be greater or equal to " + MIN_SQ_VERSION;
return "SonarQube Server instance has version " + serverStatus.getVersion() + ". Version should be greater or equal to " + MIN_SQ_VERSION;
}

private static String serverNotReady(ServerStatusInfo serverStatus) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void failWhenIncompatibleVersion() {

var throwable = catchThrowable(() -> underTest.checkVersionAndStatus(new SonarLintCancelMonitor()));

assertThat(throwable).hasMessage("SonarQube server has version 6.7. Version should be greater or equal to 9.9");
assertThat(throwable).hasMessage("SonarQube Server instance has version 6.7. Version should be greater or equal to 9.9");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ void it_should_not_permit_status_change_on_local_only_issues_for_sonarcloud() th
.succeedsWithin(Duration.ofSeconds(2))
.extracting(CheckStatusChangePermittedResponse::isPermitted, CheckStatusChangePermittedResponse::getNotPermittedReason,
CheckStatusChangePermittedResponse::getAllowedStatuses)
.containsExactly(false, "Marking a local-only issue as resolved requires SonarQube 10.2+", List.of());
.containsExactly(false, "Marking a local-only issue as resolved requires SonarQube Server 10.2+", List.of());
}

@Test
Expand All @@ -265,7 +265,7 @@ void it_should_not_permit_status_change_on_local_only_issues_for_sonarqube_prior
.succeedsWithin(Duration.ofSeconds(2))
.extracting(CheckStatusChangePermittedResponse::isPermitted, CheckStatusChangePermittedResponse::getNotPermittedReason,
CheckStatusChangePermittedResponse::getAllowedStatuses)
.containsExactly(false, "Marking a local-only issue as resolved requires SonarQube 10.2+", List.of());
.containsExactly(false, "Marking a local-only issue as resolved requires SonarQube Server 10.2+", List.of());
}

@Test
Expand Down

0 comments on commit 88bb62e

Please sign in to comment.