aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-auth-ldap/src
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2021-10-22 10:38:45 -0500
committersonartech <sonartech@sonarsource.com>2021-10-25 20:03:24 +0000
commit6519110cd4f98fabf3bef46896eecbead3eb646a (patch)
treead84a08da8ba0d590dd1a2d5e9bd2f85ff1c8a8e /server/sonar-auth-ldap/src
parent7525c90c3f489b47e902e5f8eecce2c9deab9658 (diff)
downloadsonarqube-6519110cd4f98fabf3bef46896eecbead3eb646a.tar.gz
sonarqube-6519110cd4f98fabf3bef46896eecbead3eb646a.zip
Fix code quality issues
Diffstat (limited to 'server/sonar-auth-ldap/src')
-rw-r--r--server/sonar-auth-ldap/src/test/java/org/sonar/auth/ldap/LdapAutodiscoveryTest.java4
-rw-r--r--server/sonar-auth-ldap/src/test/java/org/sonar/auth/ldap/LdapGroupMappingTest.java2
2 files changed, 3 insertions, 3 deletions
diff --git a/server/sonar-auth-ldap/src/test/java/org/sonar/auth/ldap/LdapAutodiscoveryTest.java b/server/sonar-auth-ldap/src/test/java/org/sonar/auth/ldap/LdapAutodiscoveryTest.java
index f4d527f376b..d39bccde4b2 100644
--- a/server/sonar-auth-ldap/src/test/java/org/sonar/auth/ldap/LdapAutodiscoveryTest.java
+++ b/server/sonar-auth-ldap/src/test/java/org/sonar/auth/ldap/LdapAutodiscoveryTest.java
@@ -63,7 +63,7 @@ public class LdapAutodiscoveryTest {
assertThat(new LdapSrvRecord("http://foo:389", 1, 1)).isEqualTo(new LdapSrvRecord("http://foo:389", 2, 0));
assertThat(new LdapSrvRecord("http://foo:389", 1, 1)).isNotEqualTo(new LdapSrvRecord("http://foo:388", 1, 1));
- assertThat(new LdapSrvRecord("http://foo:389", 1, 1).hashCode()).isEqualTo(new LdapSrvRecord("http://foo:389", 1, 1).hashCode());
+ assertThat(new LdapSrvRecord("http://foo:389", 1, 1)).hasSameHashCodeAs(new LdapSrvRecord("http://foo:389", 1, 1).hashCode());
}
@Test
@@ -74,7 +74,7 @@ public class LdapAutodiscoveryTest {
NamingEnumeration namingEnumeration = mock(NamingEnumeration.class);
when(context.getAttributes(Mockito.anyString(), Mockito.anyObject())).thenReturn(attributes);
- when(attributes.get(Mockito.eq("srv"))).thenReturn(attribute);
+ when(attributes.get("srv")).thenReturn(attribute);
when(attribute.getAll()).thenReturn(namingEnumeration);
when(namingEnumeration.hasMore()).thenReturn(true, true, true, true, true, false);
when(namingEnumeration.next())
diff --git a/server/sonar-auth-ldap/src/test/java/org/sonar/auth/ldap/LdapGroupMappingTest.java b/server/sonar-auth-ldap/src/test/java/org/sonar/auth/ldap/LdapGroupMappingTest.java
index d7eb43a8896..50060cf2935 100644
--- a/server/sonar-auth-ldap/src/test/java/org/sonar/auth/ldap/LdapGroupMappingTest.java
+++ b/server/sonar-auth-ldap/src/test/java/org/sonar/auth/ldap/LdapGroupMappingTest.java
@@ -35,7 +35,7 @@ public class LdapGroupMappingTest {
assertThat(groupMapping.getRequest()).isEqualTo("(&(objectClass=groupOfUniqueNames)(uniqueMember={0}))");
assertThat(groupMapping.getRequiredUserAttributes()).isEqualTo(new String[] {"dn"});
- assertThat(groupMapping.toString()).isEqualTo("LdapGroupMapping{" +
+ assertThat(groupMapping).hasToString("LdapGroupMapping{" +
"baseDn=null," +
" idAttribute=cn," +
" requiredUserAttributes=[dn]," +