Test DirContextProcessor Runtime Hints

Issue gh-721
This commit is contained in:
Josh Cummings
2023-02-15 09:44:44 -07:00
parent 8fa27ad611
commit c25e11c57a

View File

@@ -1,5 +1,9 @@
package org.springframework.ldap.aot.hint;
import javax.naming.ldap.PagedResultsControl;
import javax.naming.ldap.PagedResultsResponseControl;
import javax.naming.ldap.SortControl;
import javax.naming.ldap.SortResponseControl;
import javax.net.ssl.SSLSocketFactory;
import org.junit.Before;
@@ -48,6 +52,30 @@ public class LdapCoreRuntimeHintsTests {
.accepts(this.hints);
}
@Test
public void pagedResultsControlHasHints() {
assertThat(RuntimeHintsPredicates.reflection().onType(PagedResultsControl.class).withMemberCategories(
MemberCategory.INVOKE_PUBLIC_METHODS, MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS)).accepts(this.hints);
assertThat(RuntimeHintsPredicates.reflection().onType(com.sun.jndi.ldap.ctl.PagedResultsControl.class).withMemberCategories(
MemberCategory.INVOKE_PUBLIC_METHODS, MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS)).accepts(this.hints);
assertThat(RuntimeHintsPredicates.reflection().onType(PagedResultsResponseControl.class).withMemberCategories(
MemberCategory.INVOKE_PUBLIC_METHODS, MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS)).accepts(this.hints);
assertThat(RuntimeHintsPredicates.reflection().onType(com.sun.jndi.ldap.ctl.PagedResultsResponseControl.class).withMemberCategories(
MemberCategory.INVOKE_PUBLIC_METHODS, MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS)).accepts(this.hints);
}
@Test
public void sortControlHasHints() {
assertThat(RuntimeHintsPredicates.reflection().onType(SortControl.class).withMemberCategories(
MemberCategory.INVOKE_PUBLIC_METHODS, MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS)).accepts(this.hints);
assertThat(RuntimeHintsPredicates.reflection().onType(com.sun.jndi.ldap.ctl.SortControl.class).withMemberCategories(
MemberCategory.INVOKE_PUBLIC_METHODS, MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS)).accepts(this.hints);
assertThat(RuntimeHintsPredicates.reflection().onType(SortResponseControl.class).withMemberCategories(
MemberCategory.INVOKE_PUBLIC_METHODS, MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS)).accepts(this.hints);
assertThat(RuntimeHintsPredicates.reflection().onType(com.sun.jndi.ldap.ctl.SortResponseControl.class).withMemberCategories(
MemberCategory.INVOKE_PUBLIC_METHODS, MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS)).accepts(this.hints);
}
@Test
public void sslSocketFactoryHasHints() throws Exception {
assertThat(RuntimeHintsPredicates.reflection().onMethod(SSLSocketFactory.class.getDeclaredMethod("getDefault")))