@Test
public void testPostProcessBeforeInitializationWithLdapNameAwareNoBasePathSet() throws Exception {

    final LdapContextSource expectedContextSource = new LdapContextSource();
    String expectedPath = "dc=example, dc=com";
    expectedContextSource.setBase(expectedPath);
    tested = new BaseLdapPathBeanPostProcessor() {
        BaseLdapPathSource getBaseLdapPathSourceFromApplicationContext() {
            return expectedContextSource;
        }
    };
    Object result = tested.postProcessBeforeInitialization(ldapNameAwareMock, "someName");
    verify(ldapNameAwareMock).setBaseLdapPath(LdapUtils.newLdapName(expectedPath));
    assertThat(result).isSameAs(ldapNameAwareMock);
}