diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2016-06-17 18:01:48 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2016-06-29 08:39:32 +0200 |
commit | 102faa7f46c509fd2bf7f3d933b78375ca2f4166 (patch) | |
tree | 46bd422b6d69e8c1e9c6e27b1ca2e9f0edeb74cb /sonar-plugin-api | |
parent | 9dc5ec05a0301fb2b46b621c5de3eb5ef4752119 (diff) | |
download | sonarqube-102faa7f46c509fd2bf7f3d933b78375ca2f4166.tar.gz sonarqube-102faa7f46c509fd2bf7f3d933b78375ca2f4166.zip |
SONAR-7732 Authentication is now done in Java
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/server/authentication/UserIdentity.java | 14 | ||||
-rw-r--r-- | sonar-plugin-api/src/test/java/org/sonar/api/server/authentication/UserIdentityTest.java | 8 |
2 files changed, 11 insertions, 11 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/authentication/UserIdentity.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/authentication/UserIdentity.java index 6de9f513113..65753247e7c 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/server/authentication/UserIdentity.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/authentication/UserIdentity.java @@ -19,6 +19,12 @@ */ package org.sonar.api.server.authentication; +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.google.common.collect.FluentIterable.from; +import static org.apache.commons.lang.StringUtils.isNotBlank; +import static org.sonar.api.user.UserGroupValidation.validateGroupName; + import com.google.common.base.Predicate; import java.util.HashSet; import java.util.Set; @@ -28,12 +34,6 @@ import javax.annotation.Nullable; import javax.annotation.concurrent.Immutable; import org.sonar.api.CoreProperties; -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; -import static com.google.common.collect.FluentIterable.from; -import static org.apache.commons.lang.StringUtils.isNotBlank; -import static org.sonar.api.user.UserGroupValidation.validateGroupName; - /** * User information provided by the Identity Provider to be register into the platform. * @@ -171,7 +171,7 @@ public final class UserIdentity { * @since 5.5 */ public Builder setGroups(Set<String> groups) { - checkNotNull(groups, "Groups cannot be null, please don't this method if groups should not be synchronized."); + checkNotNull(groups, "Groups cannot be null, please don't use this method if groups should not be synchronized."); from(groups).filter(ValidateGroupName.INSTANCE).toList(); this.groupsProvided = true; this.groups = groups; diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/server/authentication/UserIdentityTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/server/authentication/UserIdentityTest.java index 3ef0c9f9bbd..5c41e477d91 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/server/authentication/UserIdentityTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/server/authentication/UserIdentityTest.java @@ -19,14 +19,14 @@ */ package org.sonar.api.server.authentication; +import static com.google.common.collect.Sets.newHashSet; +import static org.assertj.core.api.Assertions.assertThat; + import com.google.common.base.Strings; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; -import static com.google.common.collect.Sets.newHashSet; -import static org.assertj.core.api.Assertions.assertThat; - public class UserIdentityTest { @Rule @@ -195,7 +195,7 @@ public class UserIdentityTest { @Test public void fail_when_groups_are_null() throws Exception { thrown.expect(NullPointerException.class); - thrown.expectMessage("Groups cannot be null, please don't this method if groups should not be synchronized."); + thrown.expectMessage("Groups cannot be null, please don't use this method if groups should not be synchronized."); UserIdentity.builder() .setProviderLogin("john") |