LdapAuthenticationFilter extends OncePerRequestFilter { String userDnFrom(final Credentials credentials, String baseDN) { return format("%s=%s,%s", ldapProperties.getRdnIdentifier(), credentials.getUsername(), baseDN); } LdapAuthenticationFilter(final LdapProperties ldapProperties, final LdapConnectionFactory ldapConnectionFactory);   }
@Test public void shouldBuildUserDnFromCredentials() { final String userDn = testee.userDnFrom(new Credentials("user", "password"), "someBaseDn"); assertThat(userDn).isEqualTo("someRdnIdentifier=user,someBaseDn"); }