From 102faa7f46c509fd2bf7f3d933b78375ca2f4166 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Fri, 17 Jun 2016 18:01:48 +0200 Subject: SONAR-7732 Authentication is now done in Java --- .../org/sonar/api/server/authentication/UserIdentity.java | 14 +++++++------- .../sonar/api/server/authentication/UserIdentityTest.java | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'sonar-plugin-api') 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 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") -- cgit v1.2.3