diff --git a/core/src/test/java/org/springframework/security/core/userdetails/UserTests.java b/core/src/test/java/org/springframework/security/core/userdetails/UserTests.java index b394c0f959..dc81d2b977 100644 --- a/core/src/test/java/org/springframework/security/core/userdetails/UserTests.java +++ b/core/src/test/java/org/springframework/security/core/userdetails/UserTests.java @@ -129,7 +129,7 @@ public class UserTests { "ROLE_ONE"); assertThat(AuthorityUtils.authorityListToSet(user.getAuthorities())).contains( "ROLE_TWO"); - assertThat(user.toString().indexOf("rod") != -1).isTrue(); + assertThat(user.toString()).contains("rod"); } @Test