aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Gageot <david@gageot.net>2012-07-16 16:22:11 +0200
committerDavid Gageot <david@gageot.net>2012-07-16 16:22:11 +0200
commit0b9545a8b74aca473cb776275be4dc93a327c363 (patch)
tree51eb211e79fc746712644a930ff7b18e948557fa
parentaf18bdc024a770f822ea39e458ec589a2e6c10e1 (diff)
downloadsonarqube-0b9545a8b74aca473cb776275be4dc93a327c363.tar.gz
sonarqube-0b9545a8b74aca473cb776275be4dc93a327c363.zip
Remove warnings
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/security/ExternalUsersProvider.java1
-rw-r--r--sonar-server/src/test/java/org/sonar/server/startup/ServerMetadataPersisterTest.java18
2 files changed, 6 insertions, 13 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/security/ExternalUsersProvider.java b/sonar-plugin-api/src/main/java/org/sonar/api/security/ExternalUsersProvider.java
index 25a9bbea7a0..1a3f6886299 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/security/ExternalUsersProvider.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/security/ExternalUsersProvider.java
@@ -33,6 +33,7 @@ public abstract class ExternalUsersProvider {
/**
* This method is overridden by old versions of plugins such as LDAP 1.1. It should be overridden anymore.
*
+ * @param username the username
* @return details for specified user, or null if such user doesn't exist
* @throws RuntimeException in case of unexpected error such as connection failure
* @deprecated replaced by {@link #doGetUserDetails(org.sonar.api.security.ExternalUsersProvider.Context)} since v. 3.1
diff --git a/sonar-server/src/test/java/org/sonar/server/startup/ServerMetadataPersisterTest.java b/sonar-server/src/test/java/org/sonar/server/startup/ServerMetadataPersisterTest.java
index 67dd9290b6c..beef9e2db4d 100644
--- a/sonar-server/src/test/java/org/sonar/server/startup/ServerMetadataPersisterTest.java
+++ b/sonar-server/src/test/java/org/sonar/server/startup/ServerMetadataPersisterTest.java
@@ -19,10 +19,10 @@
*/
package org.sonar.server.startup;
+import com.google.common.collect.ImmutableMap;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import org.mockito.ArgumentMatcher;
import org.sonar.api.CoreProperties;
import org.sonar.api.platform.Server;
import org.sonar.server.platform.PersistentSettings;
@@ -30,10 +30,8 @@ import org.sonar.server.platform.PersistentSettings;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
-import java.util.Map;
import java.util.TimeZone;
-import static org.mockito.Matchers.argThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -66,16 +64,10 @@ public class ServerMetadataPersisterTest {
ServerMetadataPersister persister = new ServerMetadataPersister(server, persistentSettings);
persister.start();
- verify(persistentSettings).saveProperties(argThat(new ArgumentMatcher<Map<String, String>>() {
- @Override
- public boolean matches(Object o) {
- Map<String, String> map = (Map<String, String>) o;
- return map.get(CoreProperties.SERVER_ID).equals("123")
- && map.get(CoreProperties.SERVER_VERSION).equals("3.2")
- && map.get(CoreProperties.SERVER_STARTTIME).equals("2010-05-18T17:59:00+0000")
- && map.size() == 3;
- }
- }));
+ verify(persistentSettings).saveProperties(ImmutableMap.of(
+ CoreProperties.SERVER_ID, "123",
+ CoreProperties.SERVER_VERSION, "3.2",
+ CoreProperties.SERVER_STARTTIME, "2010-05-18T17:59:00+0000"));
}
}