Polish AssertJ assertions

Fixes gh-4770
This commit is contained in:
Antoine
2017-04-13 16:13:52 +02:00
committed by Rob Winch
parent c7cf6fdd73
commit 21efbb6ba7
36 changed files with 154 additions and 179 deletions

View File

@@ -157,7 +157,7 @@ public class SpringSecurityLdapTemplateITests extends AbstractLdapIntegrationTes
protected void assertAttributeValue(Map<String, List<String>> record,
String attributeName, String... values) {
assertThat(record.containsKey(attributeName)).isTrue();
assertThat(record.get(attributeName).size()).isEqualTo(values.length);
assertThat(record.get(attributeName)).hasSize(values.length);
for (int i = 0; i < values.length; i++) {
assertThat(record.get(attributeName).get(i)).isEqualTo(values[i]);
}

View File

@@ -122,7 +122,7 @@ public class NestedLdapAuthoritiesPopulatorTests extends AbstractLdapIntegration
circularJavaDevelopers, jDevelopers, groovyDevelopers));
LdapAuthority[] ldapAuthorities = authorities.toArray(new LdapAuthority[0]);
assertThat(ldapAuthorities.length).isEqualTo(5);
assertThat(ldapAuthorities).hasSize(5);
// closure group
assertThat(ldapAuthorities[0].getAttributes().containsKey("member")).isTrue();
assertThat(ldapAuthorities[0].getAttributes().get("member")).isNotNull();