Skip to content

Commit bdbbd72

Browse files
committed
Issues: gh-430 gh-432
1 parent 6be3662 commit bdbbd72

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package org.springframework.ldap.core.support;
2+
3+
import org.junit.Test;
4+
import org.junit.runner.RunWith;
5+
import org.mockito.Mock;
6+
import org.mockito.runners.MockitoJUnitRunner;
7+
8+
import javax.naming.ldap.LdapContext;
9+
10+
import static org.assertj.core.api.Assertions.*;
11+
import static org.mockito.Mockito.verify;
12+
13+
/**
14+
* @author Rob Winch
15+
* @since 5.0
16+
*/
17+
@RunWith(MockitoJUnitRunner.class)
18+
public class DefaultTlsDirContextAuthenticationStrategyTests {
19+
@Mock
20+
private LdapContext context;
21+
22+
private DefaultTlsDirContextAuthenticationStrategy strategy = new DefaultTlsDirContextAuthenticationStrategy();
23+
24+
// gh-430
25+
@Test
26+
public void applyAuthenticationThenReconnectInvoked() throws Exception {
27+
this.strategy.applyAuthentication(this.context, "username", "password");
28+
29+
verify(this.context).reconnect(null);
30+
}
31+
}

0 commit comments

Comments
 (0)