aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-server-common
diff options
context:
space:
mode:
authorLéo Geoffroy <99647462+leo-geoffroy-sonarsource@users.noreply.github.com>2022-10-11 09:23:16 +0200
committersonartech <sonartech@sonarsource.com>2022-10-12 20:03:44 +0000
commit2c36dc6f775adbdbd6688a9329064ec0ff332941 (patch)
tree46eba88e9c4b173ddd72697ad00b367555184c4e /server/sonar-server-common
parentb6bffded1c8e125cb2621b47ddcb9ddb0799b98f (diff)
downloadsonarqube-2c36dc6f775adbdbd6688a9329064ec0ff332941.tar.gz
sonarqube-2c36dc6f775adbdbd6688a9329064ec0ff332941.zip
SONAR-17412 minor fixes on log and tests (#6812)
Diffstat (limited to 'server/sonar-server-common')
-rw-r--r--server/sonar-server-common/src/main/java/org/sonar/server/favorite/FavoriteUpdater.java4
-rw-r--r--server/sonar-server-common/src/test/java/org/sonar/server/favorite/FavoriteUpdaterTest.java2
2 files changed, 3 insertions, 3 deletions
diff --git a/server/sonar-server-common/src/main/java/org/sonar/server/favorite/FavoriteUpdater.java b/server/sonar-server-common/src/main/java/org/sonar/server/favorite/FavoriteUpdater.java
index 2e27ce531f5..261bd7fee94 100644
--- a/server/sonar-server-common/src/main/java/org/sonar/server/favorite/FavoriteUpdater.java
+++ b/server/sonar-server-common/src/main/java/org/sonar/server/favorite/FavoriteUpdater.java
@@ -51,7 +51,7 @@ public class FavoriteUpdater {
.setUserUuid(userUuid)
.setComponentUuid(componentDto.uuid())
.build(), dbSession);
- checkArgument(existingFavoriteOnComponent.isEmpty(), "Component '%s' is already a favorite", componentDto.getKey());
+ checkArgument(existingFavoriteOnComponent.isEmpty(), "Component '%s' (uuid: %s) is already a favorite", componentDto.getKey(), componentDto.uuid());
List<PropertyDto> existingFavorites = dbClient.propertiesDao().selectByKeyAndUserUuidAndComponentQualifier(dbSession, PROP_FAVORITE_KEY, userUuid, componentDto.qualifier());
if (existingFavorites.size() >= 100) {
@@ -81,6 +81,6 @@ public class FavoriteUpdater {
.setComponentUuid(component.uuid())
.setUserUuid(userUuid),
userLogin, component.getKey(), component.name(), component.qualifier());
- checkArgument(result == 1, "Component '%s' is not a favorite", component.getKey());
+ checkArgument(result == 1, "Component '%s' (uuid: %s) is not a favorite", component.getKey(), component.uuid());
}
}
diff --git a/server/sonar-server-common/src/test/java/org/sonar/server/favorite/FavoriteUpdaterTest.java b/server/sonar-server-common/src/test/java/org/sonar/server/favorite/FavoriteUpdaterTest.java
index 3678a2656eb..8bcd228f662 100644
--- a/server/sonar-server-common/src/test/java/org/sonar/server/favorite/FavoriteUpdaterTest.java
+++ b/server/sonar-server-common/src/test/java/org/sonar/server/favorite/FavoriteUpdaterTest.java
@@ -118,7 +118,7 @@ public class FavoriteUpdaterTest {
assertThatThrownBy(() -> underTest.add(dbSession, project, user.getUuid(), user.getLogin(), true))
.isInstanceOf(IllegalArgumentException.class)
- .hasMessage(String.format("Component '%s' is already a favorite", project.getKey()));
+ .hasMessage(String.format("Component '%s' (uuid: %s) is already a favorite", project.getKey(), project.uuid()));
}
private void assertFavorite(ComponentDto project, UserDto user) {