Skip to content

Commit c25e11c

Browse files
committed
Test DirContextProcessor Runtime Hints
Issue spring-projectsgh-721
1 parent 8fa27ad commit c25e11c

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

core/src/test/java/org/springframework/ldap/aot/hint/LdapCoreRuntimeHintsTests.java

+28
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
package org.springframework.ldap.aot.hint;
22

3+
import javax.naming.ldap.PagedResultsControl;
4+
import javax.naming.ldap.PagedResultsResponseControl;
5+
import javax.naming.ldap.SortControl;
6+
import javax.naming.ldap.SortResponseControl;
37
import javax.net.ssl.SSLSocketFactory;
48

59
import org.junit.Before;
@@ -48,6 +52,30 @@ public void defaultDirObjectFactoryHasHints() {
4852
.accepts(this.hints);
4953
}
5054

55+
@Test
56+
public void pagedResultsControlHasHints() {
57+
assertThat(RuntimeHintsPredicates.reflection().onType(PagedResultsControl.class).withMemberCategories(
58+
MemberCategory.INVOKE_PUBLIC_METHODS, MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS)).accepts(this.hints);
59+
assertThat(RuntimeHintsPredicates.reflection().onType(com.sun.jndi.ldap.ctl.PagedResultsControl.class).withMemberCategories(
60+
MemberCategory.INVOKE_PUBLIC_METHODS, MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS)).accepts(this.hints);
61+
assertThat(RuntimeHintsPredicates.reflection().onType(PagedResultsResponseControl.class).withMemberCategories(
62+
MemberCategory.INVOKE_PUBLIC_METHODS, MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS)).accepts(this.hints);
63+
assertThat(RuntimeHintsPredicates.reflection().onType(com.sun.jndi.ldap.ctl.PagedResultsResponseControl.class).withMemberCategories(
64+
MemberCategory.INVOKE_PUBLIC_METHODS, MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS)).accepts(this.hints);
65+
}
66+
67+
@Test
68+
public void sortControlHasHints() {
69+
assertThat(RuntimeHintsPredicates.reflection().onType(SortControl.class).withMemberCategories(
70+
MemberCategory.INVOKE_PUBLIC_METHODS, MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS)).accepts(this.hints);
71+
assertThat(RuntimeHintsPredicates.reflection().onType(com.sun.jndi.ldap.ctl.SortControl.class).withMemberCategories(
72+
MemberCategory.INVOKE_PUBLIC_METHODS, MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS)).accepts(this.hints);
73+
assertThat(RuntimeHintsPredicates.reflection().onType(SortResponseControl.class).withMemberCategories(
74+
MemberCategory.INVOKE_PUBLIC_METHODS, MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS)).accepts(this.hints);
75+
assertThat(RuntimeHintsPredicates.reflection().onType(com.sun.jndi.ldap.ctl.SortResponseControl.class).withMemberCategories(
76+
MemberCategory.INVOKE_PUBLIC_METHODS, MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS)).accepts(this.hints);
77+
}
78+
5179
@Test
5280
public void sslSocketFactoryHasHints() throws Exception {
5381
assertThat(RuntimeHintsPredicates.reflection().onMethod(SSLSocketFactory.class.getDeclaredMethod("getDefault")))

0 commit comments

Comments
 (0)