From 7a3e85587ad98d5db9bd3b338f476175a900460b Mon Sep 17 00:00:00 2001 From: Josh Cummings Date: Fri, 21 Jan 2022 14:26:22 -0700 Subject: [PATCH] Remove core-tiger Closes gh-621 --- core-tiger/.gitignore | 4 - core-tiger/.springBeans | 13 - core-tiger/build.gradle | 15 - core-tiger/src/assemble/bin-with-source.xml | 23 -- .../AbstractParameterizedContextMapper.java | 53 --- ...textMapperCallbackHandlerWithControls.java | 71 ---- .../simple/ParameterizedContextMapper.java | 42 --- ...arameterizedContextMapperWithControls.java | 35 -- .../core/simple/SimpleLdapOperations.java | 324 ------------------ .../ldap/core/simple/SimpleLdapTemplate.java | 224 ------------ .../ldap/core/simple/package.html | 8 - core-tiger/src/main/java/overview.html | 3 - ...MapperCallbackHandlerWithControlsTest.java | 107 ------ core-tiger/src/test/resources/test.ldif | 235 ------------- odm/build.gradle | 1 - settings.gradle | 3 +- test/integration-tests-ad/build.gradle | 2 +- test/integration-tests-openldap/build.gradle | 2 +- test/integration-tests-sunone/build.gradle | 2 +- test/integration-tests/build.gradle | 2 +- .../core/simple/SimpleLdapTemplateITest.java | 26 +- .../LdapContextSourceIntegrationTest.java | 4 +- .../conf/simpleLdapTemplateTestContext.xml | 2 +- 23 files changed, 22 insertions(+), 1179 deletions(-) delete mode 100644 core-tiger/.gitignore delete mode 100644 core-tiger/.springBeans delete mode 100644 core-tiger/build.gradle delete mode 100644 core-tiger/src/assemble/bin-with-source.xml delete mode 100644 core-tiger/src/main/java/org/springframework/ldap/core/simple/AbstractParameterizedContextMapper.java delete mode 100644 core-tiger/src/main/java/org/springframework/ldap/core/simple/ContextMapperCallbackHandlerWithControls.java delete mode 100644 core-tiger/src/main/java/org/springframework/ldap/core/simple/ParameterizedContextMapper.java delete mode 100644 core-tiger/src/main/java/org/springframework/ldap/core/simple/ParameterizedContextMapperWithControls.java delete mode 100644 core-tiger/src/main/java/org/springframework/ldap/core/simple/SimpleLdapOperations.java delete mode 100644 core-tiger/src/main/java/org/springframework/ldap/core/simple/SimpleLdapTemplate.java delete mode 100644 core-tiger/src/main/java/org/springframework/ldap/core/simple/package.html delete mode 100644 core-tiger/src/main/java/overview.html delete mode 100644 core-tiger/src/test/java/org/springframework/ldap/core/simple/ContextMapperCallbackHandlerWithControlsTest.java delete mode 100644 core-tiger/src/test/resources/test.ldif diff --git a/core-tiger/.gitignore b/core-tiger/.gitignore deleted file mode 100644 index 73df60d8..00000000 --- a/core-tiger/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -target -.classpath -.project -.settings diff --git a/core-tiger/.springBeans b/core-tiger/.springBeans deleted file mode 100644 index 34b281cf..00000000 --- a/core-tiger/.springBeans +++ /dev/null @@ -1,13 +0,0 @@ - - - 1 - - - - - - - - - - diff --git a/core-tiger/build.gradle b/core-tiger/build.gradle deleted file mode 100644 index 6995c7c4..00000000 --- a/core-tiger/build.gradle +++ /dev/null @@ -1,15 +0,0 @@ -plugins { - id 'io.spring.convention.spring-module' -} - -dependencies { - management platform(project(":spring-ldap-dependencies")) - api project(":spring-ldap-core") - api "org.springframework:spring-tx" - - testImplementation platform('org.junit:junit-bom') - testImplementation "org.junit.vintage:junit-vintage-engine" - testImplementation "junit:junit" - testImplementation "org.easymock:easymock" - testImplementation "org.assertj:assertj-core" -} diff --git a/core-tiger/src/assemble/bin-with-source.xml b/core-tiger/src/assemble/bin-with-source.xml deleted file mode 100644 index 7aea3312..00000000 --- a/core-tiger/src/assemble/bin-with-source.xml +++ /dev/null @@ -1,23 +0,0 @@ - - assembly - - dir - - false - - - target - - *.jar - - dist - - - src/main/java - - **/*.java - - src - - - diff --git a/core-tiger/src/main/java/org/springframework/ldap/core/simple/AbstractParameterizedContextMapper.java b/core-tiger/src/main/java/org/springframework/ldap/core/simple/AbstractParameterizedContextMapper.java deleted file mode 100644 index f8a5ac3d..00000000 --- a/core-tiger/src/main/java/org/springframework/ldap/core/simple/AbstractParameterizedContextMapper.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2005-2013 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.ldap.core.simple; - -import org.springframework.ldap.core.DirContextOperations; - -/** - * Abstract superclass that may be used instead of implementing - * {@link ParameterizedContextMapper} directly. Subclassing from this superclass, - * the supplied context will be automatically cast to - * DirContextOperations. Note that if you use your own - * DirObjectFactory, this implementation will fail with a - * ClassCastException. - * - * @author Mattias Hellborg Arthursson - * @deprecated Core classes are parameterized as of 2.0. - */ -public abstract class AbstractParameterizedContextMapper implements ParameterizedContextMapper { - - /* - * (non-Javadoc) - * - * @see org.springframework.ldap.core.ContextMapper#mapFromContext(java.lang.Object) - */ - public final T mapFromContext(Object ctx) { - return doMapFromContext((DirContextOperations) ctx); - } - - /** - * Map a single DirContextOperation to an object. The - * supplied instance is the object supplied to - * {@link #mapFromContext(Object)} cast to a - * DirContextOperations. - * - * @param ctx the context to map to an object. - * @return an object built from the data in the context. - */ - protected abstract T doMapFromContext(DirContextOperations ctx); - -} diff --git a/core-tiger/src/main/java/org/springframework/ldap/core/simple/ContextMapperCallbackHandlerWithControls.java b/core-tiger/src/main/java/org/springframework/ldap/core/simple/ContextMapperCallbackHandlerWithControls.java deleted file mode 100644 index 5e3701e2..00000000 --- a/core-tiger/src/main/java/org/springframework/ldap/core/simple/ContextMapperCallbackHandlerWithControls.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2005-2013 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.ldap.core.simple; - -import org.springframework.ldap.core.ContextMapperCallbackHandler; -import org.springframework.ldap.core.ObjectRetrievalException; - -import javax.naming.Binding; -import javax.naming.NameClassPair; -import javax.naming.ldap.HasControls; - -/** - * Currently only per request controls can be inspected via the post process - * method on a context processor. If a request control gives a different value - * for each search result, then this cannot be inspected using the existing - * support classes. An example control that requires this feature would be - * 1.3.6.1.4.1.42.2.27.9.5.8 Account usability control, that can be used with - * for example the Sun ONE or the OpenDS directory servers. - * - * The extended callback handler can pass hasControls to mapper. - * - * @author Tim Terry - * @author Ulrik Sandberg - * @deprecated use {@link org.springframework.ldap.core.support.ContextMapperCallbackHandlerWithControls} instead. - */ -public class ContextMapperCallbackHandlerWithControls extends ContextMapperCallbackHandler { - - private ParameterizedContextMapperWithControls mapper = null; - - public ContextMapperCallbackHandlerWithControls(final ParameterizedContextMapperWithControls mapper) { - super(mapper); - this.mapper = mapper; - } - - /* - * @see org.springframework.ldap.core.ContextMapperCallbackHandler# - * getObjectFromNameClassPair(javax.naming.NameClassPair) - */ - public Object getObjectFromNameClassPair(final NameClassPair nameClassPair) { - if (!(nameClassPair instanceof Binding)) { - throw new IllegalArgumentException("Parameter must be an instance of Binding"); - } - - Binding binding = (Binding) nameClassPair; - Object object = binding.getObject(); - if (object == null) { - throw new ObjectRetrievalException("Binding did not contain any object."); - } - Object result = null; - if (nameClassPair instanceof HasControls) { - result = mapper.mapFromContextWithControls(object, (HasControls) nameClassPair); - } - else { - result = mapper.mapFromContext(object); - } - return result; - } -} diff --git a/core-tiger/src/main/java/org/springframework/ldap/core/simple/ParameterizedContextMapper.java b/core-tiger/src/main/java/org/springframework/ldap/core/simple/ParameterizedContextMapper.java deleted file mode 100644 index d504c659..00000000 --- a/core-tiger/src/main/java/org/springframework/ldap/core/simple/ParameterizedContextMapper.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2005-2010 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.ldap.core.simple; - -import org.springframework.ldap.core.ContextMapper; - -import javax.naming.Binding; -import javax.naming.directory.SearchResult; - -/** - * Extension of the {@link ContextMapper} interface. Uses Java 5 covariant - * return types to override the return type of the - * {@link #mapFromContext(Object)} method to be the type parameter T. - * - * @param - * @deprecated Core classes are parameterized as of 2.0. - */ -public interface ParameterizedContextMapper extends ContextMapper { - - /** - * Map a single LDAP Context to an object. The supplied Object - * ctx is the object from a single {@link SearchResult}, - * {@link Binding}, or a lookup operation. - * - * @param ctx the context to map to an object. - * @return an object built from the data in the context. - */ - T mapFromContext(Object ctx); -} diff --git a/core-tiger/src/main/java/org/springframework/ldap/core/simple/ParameterizedContextMapperWithControls.java b/core-tiger/src/main/java/org/springframework/ldap/core/simple/ParameterizedContextMapperWithControls.java deleted file mode 100644 index a7134d2e..00000000 --- a/core-tiger/src/main/java/org/springframework/ldap/core/simple/ParameterizedContextMapperWithControls.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2005-2013 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.ldap.core.simple; - -import javax.naming.ldap.HasControls; - -/** - * Extension of the {@link ParameterizedContextMapper} interface that allows - * controls to be passed to the mapper implementation. Uses Java 5 covariant - * return types to override the return type of the - * {@link #mapFromContextWithControls(Object, HasControls)} method to be the - * type parameter T. - * - * @author Tim Terry - * @author Ulrik Sandberg - * @param return type of the {@link #mapFromContextWithControls(Object, HasControls)} method. - * @deprecated use {@link org.springframework.ldap.core.support.ContextMapperWithControls} instead. - */ -public interface ParameterizedContextMapperWithControls extends ParameterizedContextMapper { - - T mapFromContextWithControls(final Object ctx, final HasControls hasControls); -} diff --git a/core-tiger/src/main/java/org/springframework/ldap/core/simple/SimpleLdapOperations.java b/core-tiger/src/main/java/org/springframework/ldap/core/simple/SimpleLdapOperations.java deleted file mode 100644 index f695dd90..00000000 --- a/core-tiger/src/main/java/org/springframework/ldap/core/simple/SimpleLdapOperations.java +++ /dev/null @@ -1,324 +0,0 @@ -/* - * Copyright 2005-2013 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.ldap.core.simple; - -import org.springframework.dao.IncorrectResultSizeDataAccessException; -import org.springframework.ldap.NamingException; -import org.springframework.ldap.core.ContextSource; -import org.springframework.ldap.core.DirContextOperations; -import org.springframework.ldap.core.DirContextProcessor; -import org.springframework.ldap.core.LdapOperations; - -import javax.naming.Name; -import javax.naming.directory.Attributes; -import javax.naming.directory.SearchControls; -import java.util.List; - -/** - * LDAP operations interface usable on Java 5 and above, exposing a set of - * common LDAP operations. - * - * @author Mattias Hellborg Arthursson - * @deprecated Core classes are parameterized as of 2.0. - */ -public interface SimpleLdapOperations { - - /** - * Get the wrapped LdapOperations instance. - * - * @return the wrapped LdapOperations instance. - * @throws NamingException if any error occurs. - */ - LdapOperations getLdapOperations(); - - /** - * Search for a List of type T using the supplied filter and link - * ParameterizedContextMapper. - * - * @param base Base DN relative to the base of the ContextSource - where to - * start the search. - * @param filter Search filter. - * @param mapper the Mapper to supply all results to. - * @return a List of type T containing objects for all entries found, as - * mapped by the ParameterizedContextMapper. - * @throws NamingException if any error occurs. - */ - List search(String base, String filter, - ParameterizedContextMapper mapper); - - /** - * Search for a List of type T using the supplied filter and link - * ParameterizedContextMapper. - * - * @param base Base DN relative to the base of the ContextSource - where to - * start the search. - * @param filter Search filter. - * @param mapper the Mapper to supply all results to. - * @return a List of type T containing objects for all entries found, as - * mapped by the ParameterizedContextMapper. - * @throws NamingException if any error occurs. - * @since 1.3 - */ - List search(Name base, String filter, - ParameterizedContextMapper mapper); - - /** - * Search for a List of type T using the supplied filter, SearchControls, - * DirContextProcessor and ParameterizedContextMapper. - * - * @param base Base DN relative to the base of the ContextSource - where to - * start the search. - * @param filter Search filter. - * @param controls the SearchControls. Make sure that the returningObjFlag - * is set to true. - * @param mapper the Mapper to supply all results to. - * @param processor the DirContextProcessor to be used for applying pre/post - * processing on the DirContext instance. - * @return a List of type T containing objects for all entries found, as - * mapped by the ParameterizedContextMapper. - * @throws NamingException if any error occurs. - */ - List search(String base, String filter, SearchControls controls, - ParameterizedContextMapper mapper, DirContextProcessor processor); - - /** - * Search for a List of type T using the supplied filter, SearchControls, - * DirContextProcessor and ParameterizedContextMapper. - * - * @param base Base DN relative to the base of the ContextSource - where to - * start the search. - * @param filter Search filter. - * @param controls the SearchControls. Make sure that the returningObjFlag - * is set to true. - * @param mapper the Mapper to supply all results to. - * @param processor the DirContextProcessor to be used for applying pre/post - * processing on the DirContext instance. - * @return a List of type T containing objects for all entries found, as - * mapped by the ParameterizedContextMapper. - * @throws NamingException if any error occurs. - * @since 1.3 - */ - List search(Name base, String filter, SearchControls controls, - ParameterizedContextMapper mapper, DirContextProcessor processor); - - /** - * Perform a lookup of the specified DN and map the result using the mapper. - * - * @param dn the Distinguished Name to look up. - * @param mapper the mapper to use. - * @return the mapped object, as received by the ParameterizedContextMapper. - * @throws NamingException if any error occurs. - */ - T lookup(String dn, ParameterizedContextMapper mapper); - - /** - * Perform a lookup of the specified DN and map the result using the mapper. - * - * @param dn the Distinguished Name to look up. - * @param mapper the mapper to use. - * @return the mapped object, as received by the ParameterizedContextMapper. - * @throws NamingException if any error occurs. - * @since 1.3 - */ - T lookup(Name dn, ParameterizedContextMapper mapper); - - /** - * Perform a search for a unique entry matching the specified search - * criteria and return the found object. If no entry is found or if there - * are more than one matching entry, an - * {@link IncorrectResultSizeDataAccessException} is thrown. - * @param base the DN to use as the base of the search. - * @param filter the search filter. - * @param mapper the mapper to use for the search. - * @return the single object returned by the mapper that matches the search - * criteria. - * @throws IncorrectResultSizeDataAccessException if the result is not one - * unique entry - * @since 1.3 - */ - T searchForObject(String base, String filter, - ParameterizedContextMapper mapper); - - /** - * Perform a search for a unique entry matching the specified search - * criteria and return the found object. If no entry is found or if there - * are more than one matching entry, an - * {@link IncorrectResultSizeDataAccessException} is thrown. - * @param base the DN to use as the base of the search. - * @param filter the search filter. - * @param mapper the mapper to use for the search. - * @return the single object returned by the mapper that matches the search - * criteria. - * @throws IncorrectResultSizeDataAccessException if the result is not one - * unique entry - * @since 1.3 - */ - T searchForObject(Name base, String filter, - ParameterizedContextMapper mapper); - - /** - * Look up the specified DN, and automatically cast it to a - * {@link DirContextOperations} instance. - * - * @param dn The Distinguished Name of the entry to look up. - * @return A {@link DirContextOperations} instance constructed from the - * found entry. - * @throws NamingException if any error occurs. - */ - DirContextOperations lookupContext(String dn); - - /** - * Look up the specified DN, and automatically cast it to a - * {@link DirContextOperations} instance. - * - * @param dn The Distinguished Name of the entry to look up. - * @return A {@link DirContextOperations} instance constructed from the - * found entry. - * @throws NamingException if any error occurs. - * @since 1.3 - */ - DirContextOperations lookupContext(Name dn); - - /** - * Create an entry in the LDAP tree. The attributes used to create the entry - * are either retrieved from the obj parameter or the - * attributes parameter (or both). One of these parameters may - * be null but not both. - * - * @param dn The distinguished name to bind the object and attributes to. - * @param obj The object to bind, may be null. Typically a DirContext - * implementation. - * @param attributes The attributes to bind, may be null. - * @throws NamingException if any error occurs. - */ - void bind(String dn, Object obj, Attributes attributes); - - /** - * Create an entry in the LDAP tree. The attributes used to create the entry - * are either retrieved from the obj parameter or the - * attributes parameter (or both). One of these parameters may - * be null but not both. - * - * @param dn The distinguished name to bind the object and attributes to. - * @param obj The object to bind, may be null. Typically a DirContext - * implementation. - * @param attributes The attributes to bind, may be null. - * @throws NamingException if any error occurs. - * @since 1.3 - */ - void bind(Name dn, Object obj, Attributes attributes); - - /** - * Bind the data in the supplied context in the tree. All specified - * Attributes in will be bound to the DN set on the instance. - * - * @param ctx the context to bind - * @throws IllegalStateException if no DN is set or if the instance is in - * update mode. - * @since 1.3 - */ - void bind(DirContextOperations ctx); - - /** - * Remove an entry from the LDAP tree. The entry must not have any children. - * - * @param dn The distinguished name to unbind. - * @throws NamingException if any error occurs. - */ - void unbind(String dn); - - /** - * Remove an entry from the LDAP tree. The entry must not have any children. - * - * @param dn The distinguished name to unbind. - * @throws NamingException if any error occurs. - * @since 1.3 - */ - void unbind(Name dn); - - /** - * Modify the Attributes of the entry corresponding to the supplied - * {@link DirContextOperations} instance. The instance should have been - * received from the {@link #lookupContext(String)} operation, and then - * modified to match the current state of the matching domain object, e.g.: - * - *
-	 * public void update(Person person) {
-	 * 	DirContextOperations ctx = simpleLdapOperations.lookup(person.getDn());
-	 * 
-	 * 	ctx.setAttributeValue("description", person.getDescription());
-	 * 	ctx.setAttributeValue("telephoneNumber", person.getPhone());
-	 * 	// More modifications here
-	 * 
-	 * 	simpleLdapOperations.modifyAttributes(ctx);
-	 * }
-	 * 
- * - * @param ctx the entry to update in the LDAP tree. - * @throws NamingException if any error occurs. - */ - void modifyAttributes(DirContextOperations ctx); - - /** - * Utility method to perform a simple LDAP 'bind' authentication. Search for - * the LDAP entry to authenticate using the supplied base DN and filter; use - * the DN of the found entry together with the password as input to - * {@link ContextSource#getContext(String, String)}, thus authenticating the - * entry. - *

- * Example:
- * - *

-	 * AndFilter filter = new AndFilter();
-	 * filter.and("objectclass", "person").and("uid", userId);
-	 * boolean authenticated = ldapTemplate.authenticate(LdapUtils.emptyLdapName(),
-	 * 		filter.toString(), password);
-	 * 
- * - * @param base the DN to use as the base of the search. - * @param filter the search filter - must result in a unique result. - * @param password the password to use for authentication. - * @return true if the authentication was successful, - * false otherwise. - * @since 1.3 - */ - boolean authenticate(String base, String filter, String password); - - /** - * Utility method to perform a simple LDAP 'bind' authentication. Search for - * the LDAP entry to authenticate using the supplied base DN and filter; use - * the DN of the found entry together with the password as input to - * {@link ContextSource#getContext(String, String)}, thus authenticating the - * entry. - *

- * Example:
- * - *

-	 * AndFilter filter = new AndFilter();
-	 * filter.and("objectclass", "person").and("uid", userId);
-	 * boolean authenticated = ldapTemplate.authenticate(LdapUtils.emptyLdapName(),
-	 * 		filter.toString(), password);
-	 * 
- * - * @param base the DN to use as the base of the search. - * @param filter the search filter - must result in a unique result. - * @param password the password to use for authentication. - * @return true if the authentication was successful, - * false otherwise. - * @since 1.3 - */ - boolean authenticate(Name base, String filter, String password); -} diff --git a/core-tiger/src/main/java/org/springframework/ldap/core/simple/SimpleLdapTemplate.java b/core-tiger/src/main/java/org/springframework/ldap/core/simple/SimpleLdapTemplate.java deleted file mode 100644 index 75ce5426..00000000 --- a/core-tiger/src/main/java/org/springframework/ldap/core/simple/SimpleLdapTemplate.java +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Copyright 2005-2010 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.ldap.core.simple; - -import org.springframework.ldap.core.ContextSource; -import org.springframework.ldap.core.DirContextOperations; -import org.springframework.ldap.core.DirContextProcessor; -import org.springframework.ldap.core.LdapOperations; -import org.springframework.ldap.core.LdapTemplate; - -import javax.naming.Name; -import javax.naming.directory.Attributes; -import javax.naming.directory.SearchControls; -import java.util.List; - -/** - * Java-5-based convenience wrapper for the classic LdapTemplate, adding some - * convenient shortcuts and taking advantage of Java 5 Generics. - * - * Use the {@link #getLdapOperations()} method if you need to invoke less - * commonly used template methods. - * - * @author Mattias Hellborg Arthursson - * @deprecated Core classes are parameterized as of 2.0. - */ -public class SimpleLdapTemplate implements SimpleLdapOperations { - - private LdapOperations ldapOperations; - - /** - * Constructs a new SimpleLdapTemplate instance wrapping the supplied - * LdapOperations instance. - * - * @param ldapOperations the LdapOperations instance to wrap. - */ - public SimpleLdapTemplate(LdapOperations ldapOperations) { - this.ldapOperations = ldapOperations; - } - - /** - * Constructs a new SimpleLdapTemplate instance, automatically creating a - * wrapped LdapTemplate instance to work with. - * - * @param contextSource - */ - public SimpleLdapTemplate(ContextSource contextSource) { - this.ldapOperations = new LdapTemplate(contextSource); - } - - /** - * {@inheritDoc} - */ - @Override - public LdapOperations getLdapOperations() { - return ldapOperations; - } - - /** - * {@inheritDoc} - */ - @Override - @SuppressWarnings("unchecked") - public T lookup(String dn, ParameterizedContextMapper mapper) { - return (T) ldapOperations.lookup(dn, mapper); - } - - /** - * {@inheritDoc} - */ - @Override - @SuppressWarnings("unchecked") - public List search(String base, String filter, ParameterizedContextMapper mapper) { - return ldapOperations.search(base, filter, mapper); - } - - /** - * {@inheritDoc} - */ - @Override - @SuppressWarnings("unchecked") - public List search(String base, String filter, SearchControls controls, - ParameterizedContextMapper mapper, DirContextProcessor processor) { - return ldapOperations.search(base, filter, controls, mapper, processor); - } - - /** - * {@inheritDoc} - */ - @Override - public DirContextOperations lookupContext(String dn) { - return ldapOperations.lookupContext(dn); - } - - /** - * {@inheritDoc} - */ - @Override - public void modifyAttributes(DirContextOperations ctx) { - ldapOperations.modifyAttributes(ctx); - } - - /** - * {@inheritDoc} - */ - @Override - public void bind(String dn, Object obj, Attributes attributes) { - ldapOperations.bind(dn, obj, attributes); - } - - /** - * {@inheritDoc} - */ - @Override - public void unbind(String dn) { - ldapOperations.unbind(dn); - } - - /** - * {@inheritDoc} - */ - @Override - public void bind(Name dn, Object obj, Attributes attributes) { - ldapOperations.bind(dn, obj, attributes); - } - - /** - * {@inheritDoc} - */ - @Override - @SuppressWarnings("unchecked") - public T lookup(Name dn, ParameterizedContextMapper mapper) { - return (T) ldapOperations.lookup(dn, mapper); - } - - /** - * {@inheritDoc} - */ - @Override - public DirContextOperations lookupContext(Name dn) { - return ldapOperations.lookupContext(dn); - } - - /** - * {@inheritDoc} - */ - @Override - @SuppressWarnings("unchecked") - public List search(Name base, String filter, ParameterizedContextMapper mapper) { - return ldapOperations.search(base, filter, mapper); - } - - /** - * {@inheritDoc} - */ - @Override - @SuppressWarnings("unchecked") - public List search(Name base, String filter, SearchControls controls, ParameterizedContextMapper mapper, - DirContextProcessor processor) { - return ldapOperations.search(base, filter, controls, mapper, processor); - } - - /** - * {@inheritDoc} - */ - @Override - public void unbind(Name dn) { - ldapOperations.unbind(dn); - } - - /** - * {@inheritDoc} - */ - @Override - public void bind(DirContextOperations ctx) { - ldapOperations.bind(ctx); - } - - /** - * {@inheritDoc} - */ - @Override - @SuppressWarnings("unchecked") - public T searchForObject(String base, String filter, ParameterizedContextMapper mapper) { - return (T) ldapOperations.searchForObject(base, filter, mapper); - } - - /** - * {@inheritDoc} - */ - @Override - @SuppressWarnings("unchecked") - public T searchForObject(Name base, String filter, ParameterizedContextMapper mapper) { - return (T) ldapOperations.searchForObject(base, filter, mapper); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean authenticate(String base, String filter, String password) { - return ldapOperations.authenticate(base, filter, password); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean authenticate(Name base, String filter, String password) { - return ldapOperations.authenticate(base, filter, password); - } -} diff --git a/core-tiger/src/main/java/org/springframework/ldap/core/simple/package.html b/core-tiger/src/main/java/org/springframework/ldap/core/simple/package.html deleted file mode 100644 index b6d396c6..00000000 --- a/core-tiger/src/main/java/org/springframework/ldap/core/simple/package.html +++ /dev/null @@ -1,8 +0,0 @@ - - - -Simplification layer over LdapTemplate for Java 5 and above. As of Spring LDAP 2.0 all interfaces and classes -in this package are deprecated. - - - diff --git a/core-tiger/src/main/java/overview.html b/core-tiger/src/main/java/overview.html deleted file mode 100644 index 28045ca7..00000000 --- a/core-tiger/src/main/java/overview.html +++ /dev/null @@ -1,3 +0,0 @@ - -This document is the API specification for the Java5-specific parts of the Spring LDAP Framework. - \ No newline at end of file diff --git a/core-tiger/src/test/java/org/springframework/ldap/core/simple/ContextMapperCallbackHandlerWithControlsTest.java b/core-tiger/src/test/java/org/springframework/ldap/core/simple/ContextMapperCallbackHandlerWithControlsTest.java deleted file mode 100644 index 001508c7..00000000 --- a/core-tiger/src/test/java/org/springframework/ldap/core/simple/ContextMapperCallbackHandlerWithControlsTest.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright 2005-2016 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.ldap.core.simple; - -import org.junit.Before; -import org.junit.Test; -import org.springframework.ldap.core.ObjectRetrievalException; - -import javax.naming.Binding; -import javax.naming.NamingException; -import javax.naming.ldap.Control; -import javax.naming.ldap.HasControls; - -import static org.easymock.EasyMock.createMock; -import static org.easymock.EasyMock.expect; -import static org.easymock.EasyMock.replay; -import static org.easymock.EasyMock.verify; -import static org.assertj.core.api.Assertions.assertThat; - -/** - * Unit tests for the {@link ContextMapperCallbackHandlerWithControlsTest} - * class. - * - * @author Ulrik Sandberg - */ -public class ContextMapperCallbackHandlerWithControlsTest { - - private ParameterizedContextMapperWithControls mapperMock; - - private ContextMapperCallbackHandlerWithControls tested; - - private static class MyBindingThatHasControls extends Binding implements HasControls { - private static final long serialVersionUID = 1L; - - public MyBindingThatHasControls(String name, Object obj) { - super(name, obj); - } - - public Control[] getControls() throws NamingException { - return null; - } - } - - @SuppressWarnings("unchecked") - @Before - public void setUp() throws Exception { - mapperMock = createMock(ParameterizedContextMapperWithControls.class); - tested = new ContextMapperCallbackHandlerWithControls(mapperMock); - } - - @Test(expected = IllegalArgumentException.class) - public void testConstructorWithEmptyArgument() { - new ContextMapperCallbackHandlerWithControls(null); - } - - @Test - public void testGetObjectFromNameClassPair() { - Object expectedObject = "object"; - Object expectedResult = "result"; - Binding expectedBinding = new Binding("some name", expectedObject); - - expect(mapperMock.mapFromContext(expectedObject)).andReturn(expectedResult); - - replay(mapperMock); - Object actualResult = tested.getObjectFromNameClassPair(expectedBinding); - verify(mapperMock); - - assertThat(actualResult).isEqualTo(expectedResult); - } - - @Test - public void testGetObjectFromNameClassPairImplementingHasControls() { - Object expectedObject = "object"; - Object expectedResult = "result"; - MyBindingThatHasControls expectedBinding = new MyBindingThatHasControls("some name", expectedObject); - - expect(mapperMock.mapFromContextWithControls(expectedObject, expectedBinding)).andReturn(expectedResult); - - replay(mapperMock); - Object actualResult = tested.getObjectFromNameClassPair(expectedBinding); - verify(mapperMock); - - assertThat(actualResult).isEqualTo(expectedResult); - } - - @Test(expected = ObjectRetrievalException.class) - public void testGetObjectFromNameClassPairObjectRetrievalException() { - Binding expectedBinding = new Binding("some name", null); - - replay(mapperMock); - tested.getObjectFromNameClassPair(expectedBinding); - verify(mapperMock); - } -} diff --git a/core-tiger/src/test/resources/test.ldif b/core-tiger/src/test/resources/test.ldif deleted file mode 100644 index 7ec2867d..00000000 --- a/core-tiger/src/test/resources/test.ldif +++ /dev/null @@ -1,235 +0,0 @@ -version: 1 - -# -#Examples of LDAP Data Interchange Format -# - -# -#Example 1: An simple LDAP file with two entries -# - -dn: cn=Barbara Jensen, ou=Product Development, dc=airius, dc=com -objectclass: top -objectclass: person -objectclass: organizationalPerson -cn: Barbara Jensen -cn: Barbara J Jensen -cn: Babs Jensen -sn: Jensen -uid: bjensen -telephonenumber: +1 408 555 1212 -description: A big sailing fan. - -dn: cn=Bjorn Jensen, ou=Accounting, dc=airius, dc=com -objectclass: top -objectclass: person -objectclass: organizationalPerson -cn: Bjorn Jensen -sn: Jensen -telephonenumber: +1 408 555 1212 - - -# -# Example 2: A file containing an entry with a folded attribute value -# - -dn:cn=Barbara Jensen, ou=Product Development, dc=airius, dc=com -objectclass:top -objectclass:person -objectclass:organizationalPerson -cn:Barbara Jensen -cn:Barbara J Jensen -cn:Babs Jensen -sn:Jensen -uid:bjensen -telephonenumber:+1 408 555 1212 -description:Babs is a big sailing fan, and travels extensively in sea - rch of perfect sailing conditions. -title:Product Manager, Rod and Reel Division - -# -# Example 3: A file containing a base-64-encoded value -# - -dn: cn=Gern Jensen, ou=Product Testing, dc=airius, dc=com -objectclass: top -objectclass: person -objectclass: organizationalPerson -cn: Gern Jensen -cn: Gern O Jensen -sn: Jensen -uid: gernj -telephonenumber: +1 408 555 1212 -description:: V2hhdCBhIGNhcmVmdWwgcmVhZGVyIHlvdSBhcmUhICBUaGlzIHZhbHVl - IGlzIGJhc2UtNjQtZW5jb2RlZCBiZWNhdXNlIGl0IGhhcyBhIGNvbnRyb2wgY2hhcmFjdG - VyIGluIGl0IChhIENSKS4NICBCeSB0aGUgd2F5LCB5b3Ugc2hvdWxkIHJlYWxseSBnZXQg - b3V0IG1vcmUu - - -# -# Example 4: A file containing an entries with UTF-8-encoded attribute -# values, including language tags. Comments indicate the contents -# of UTF-8-encoded attributes and distinguished names. -# - -dn:: b3U95Za25qWt6YOoLG89QWlyaXVz -# dn:: ou=,o=Airius -objectclass: top -objectclass: organizationalUnit -ou:: 5Za25qWt6YOo -# ou:: -ou;lang-ja:: 5Za25qWt6YOo -# ou;lang-ja:: -ou;lang-ja;phonetic:: 44GI44GE44GO44KH44GG44G2 -# ou;lang-ja:: -ou;lang-en: Sales -description: Japanese office - -dn:: dWlkPXJvZ2FzYXdhcmEsb3U95Za25qWt6YOoLG89QWlyaXVz -# dn:: uid=,ou=,o=Airius -userpassword: {SHA}O3HSv1MusyL4kTjP+HKI5uxuNoM= -objectclass: top -objectclass: person -objectclass: organizationalPerson -objectclass: inetOrgPerson -uid: rogasawara -mail: rogasawara@airius.co.jp -givenname;lang-ja:: 44Ot44OJ44OL44O8 -# givenname;lang-ja:: -sn;lang-ja:: 5bCP56yg5Y6f -# sn;lang-ja:: -cn;lang-ja:: 5bCP56yg5Y6fIOODreODieODi+ODvA== -# cn;lang-ja:: -title;lang-ja:: 5Za25qWt6YOoIOmDqOmVtw== -# title;lang-ja:: -preferredlanguage: ja -givenname:: 44Ot44OJ44OL44O8 -# givenname:: -sn:: 5bCP56yg5Y6f -# sn:: -cn:: 5bCP56yg5Y6fIOODreODieODi+ODvA== -# cn:: -title:: 5Za25qWt6YOoIOmDqOmVtw== -# title:: -givenname;lang-ja;phonetic:: 44KN44Gp44Gr44O8 -# givenname;lang-ja;phonetic:: -# -sn;lang-ja;phonetic:: 44GK44GM44GV44KP44KJ -# sn;lang-ja;phonetic:: -cn;lang-ja;phonetic:: 44GK44GM44GV44KP44KJIOOCjeOBqeOBq+ODvA== -# cn;lang-ja;phonetic:: -title;lang-ja;phonetic:: 44GI44GE44GO44KH44GG44G2IOOBtuOBoeOCh+OBhg== -# title;lang-ja;phonetic:: -# -givenname;lang-en: Rodney -sn;lang-en: Ogasawara -cn;lang-en: Rodney Ogasawara -title;lang-en: Sales, Director - - -# -# Example 5: An LDIF file containing an invalid attribute -# - -dn: cn=Harry Jacobs, ou=Product Development, dc=airius, dc=com -objectClass: top -objectClass: person -cn: Harry Jacobs -description: :A big sailing fan. - - -# -# Example 6: A file containing a reference to an external file -# - -dn: cn=Horatio Jensen, ou=Product Testing, dc=airius, dc=com -objectclass: top -objectclass: person -objectclass: organizationalPerson -cn: Horatio Jensen -cn: Horatio N Jensen -sn: Jensen -uid: hjensen -telephonenumber: +1 408 555 1212 -jpegphoto:< file:///usr/local/directory/photos/hjensen.jpg - - -# -# Example 7: A file containing a series of change records and comments -# - -# Add a new entry -dn: cn=Fiona Jensen, ou=Marketing, dc=airius, dc=com -changetype: add -objectclass: top -objectclass: person -objectclass: organizationalPerson -cn: Fiona Jensen -sn: Jensen -uid: fiona -telephonenumber: +1 408 555 1212 -jpegphoto:< file:///usr/local/directory/photos/fiona.jpg - -# Delete an existing entry -dn: cn=Robert Jensen, ou=Marketing, dc=airius, dc=com -changetype: delete - -# Modify an entry's relative distinguished name -dn: cn=Paul Jensen, ou=Product Development, dc=airius, dc=com -changetype: modrdn -newrdn: cn=Paula Jensen -deleteoldrdn: 1 - -# Rename an entry and move all of its children to a new location in -# the directory tree (only implemented by LDAPv3 servers). -dn: ou=PD Accountants, ou=Product Development, dc=airius, dc=com -changetype: modrdn -newrdn: ou=Product Development Accountants -deleteoldrdn: 0 -newsuperior: ou=Accounting, dc=airius, dc=com - - -# Modify an entry: add an additional value to the postaladdress -# attribute, completely delete the description attribute, replace -# the telephonenumber attribute with two values, and delete a specific -# value from the facsimiletelephonenumber attribute -dn: cn=Paula Jensen, ou=Product Development, dc=airius, dc=com -changetype: modify -add: postaladdress -postaladdress: 123 Anystreet $ Sunnyvale, CA $ 94086 -- - -delete: description -- -replace: telephonenumber -telephonenumber: +1 408 555 1234 -telephonenumber: +1 408 555 5678 -- -delete: facsimiletelephonenumber -facsimiletelephonenumber: +1 408 555 9876 -- - -# Modify an entry: replace the postaladdress attribute with an empty -# set of values (which will cause the attribute to be removed), and -# delete the entire description attribute. Note that the first will -# always succeed, while the second will only succeed if at least -# one value for the description attribute is present. -dn: cn=Ingrid Jensen, ou=Product Support, dc=airius, dc=com -changetype: modify -replace: postaladdress -- -delete: description -- - - -# -# Example 8: An LDIF file containing a change record with a control -# - -# Delete an entry. The operation will attach the LDAPv3 -# Tree Delete Control defined in [9]. The criticality -# field is "true" and the controlValue field is -# absent, as required by [9]. -dn: ou=Product Development, dc=airius, dc=com -control: 1.2.840.113556.1.4.805 true -changetype: delete diff --git a/odm/build.gradle b/odm/build.gradle index 48a98931..90030bcc 100644 --- a/odm/build.gradle +++ b/odm/build.gradle @@ -9,7 +9,6 @@ jar { dependencies { management platform(project(":spring-ldap-dependencies")) api project(":spring-ldap-core") - api project(":spring-ldap-core-tiger") api "org.springframework:spring-core" implementation "org.freemarker:freemarker" diff --git a/settings.gradle b/settings.gradle index db70184c..89207552 100644 --- a/settings.gradle +++ b/settings.gradle @@ -23,7 +23,6 @@ dependencyResolutionManagement { rootProject.name = 'spring-ldap' include 'core' -include 'core-tiger' include 'dependencies' include 'test-support' include 'ldif/ldif-core' @@ -50,4 +49,4 @@ rootProject.children.each { p-> p.name = "spring-ldap-" + name } -findProject(":spring-ldap-test-support").name = "spring-ldap-test" \ No newline at end of file +findProject(":spring-ldap-test-support").name = "spring-ldap-test" diff --git a/test/integration-tests-ad/build.gradle b/test/integration-tests-ad/build.gradle index ace7acce..5f1dde59 100644 --- a/test/integration-tests-ad/build.gradle +++ b/test/integration-tests-ad/build.gradle @@ -4,7 +4,7 @@ dependencies { management platform(project(":spring-ldap-dependencies")) implementation project(":spring-ldap-test") implementation project(":spring-ldap-odm") - implementation project(":spring-ldap-core-tiger") + implementation project(":spring-ldap-core") provided "org.springframework:spring-jdbc" provided "org.springframework:spring-orm" diff --git a/test/integration-tests-openldap/build.gradle b/test/integration-tests-openldap/build.gradle index 32bf6edb..fdfdc67e 100644 --- a/test/integration-tests-openldap/build.gradle +++ b/test/integration-tests-openldap/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'io.spring.convention.spring-test' dependencies { management platform(project(":spring-ldap-dependencies")) - implementation project(":spring-ldap-core-tiger") + implementation project(":spring-ldap-core") implementation project(":spring-ldap-test") implementation "commons-lang:commons-lang" implementation "commons-logging:commons-logging" diff --git a/test/integration-tests-sunone/build.gradle b/test/integration-tests-sunone/build.gradle index bd3b1267..cbf32c75 100644 --- a/test/integration-tests-sunone/build.gradle +++ b/test/integration-tests-sunone/build.gradle @@ -5,7 +5,7 @@ dependencies { implementation project(":spring-ldap-test") implementation project(":spring-ldap-integration-tests") implementation project(":spring-ldap-sandbox") - implementation project(":spring-ldap-core-tiger") + implementation project(":spring-ldap-core") implementation "commons-pool:commons-pool" provided "org.springframework:spring-jdbc" diff --git a/test/integration-tests/build.gradle b/test/integration-tests/build.gradle index d65aaf8f..aac3f848 100644 --- a/test/integration-tests/build.gradle +++ b/test/integration-tests/build.gradle @@ -18,7 +18,7 @@ sourceSets { dependencies { management platform(project(":spring-ldap-dependencies")) implementation project(":spring-ldap-test"), - project(":spring-ldap-core-tiger") + project(":spring-ldap-core") implementation "com.querydsl:querydsl-apt", "commons-lang:commons-lang" diff --git a/test/integration-tests/src/test/java/org/springframework/ldap/itest/core/simple/SimpleLdapTemplateITest.java b/test/integration-tests/src/test/java/org/springframework/ldap/itest/core/simple/SimpleLdapTemplateITest.java index a18b3e00..143e2a7b 100644 --- a/test/integration-tests/src/test/java/org/springframework/ldap/itest/core/simple/SimpleLdapTemplateITest.java +++ b/test/integration-tests/src/test/java/org/springframework/ldap/itest/core/simple/SimpleLdapTemplateITest.java @@ -15,15 +15,23 @@ */ package org.springframework.ldap.itest.core.simple; +import java.util.List; + +import javax.naming.NamingException; +import javax.naming.directory.DirContext; +import javax.naming.directory.SearchControls; +import javax.naming.ldap.LdapName; + import org.junit.Test; import org.junit.experimental.categories.Category; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.ldap.NameNotFoundException; +import org.springframework.ldap.core.ContextMapper; import org.springframework.ldap.core.DirContextAdapter; import org.springframework.ldap.core.DirContextOperations; import org.springframework.ldap.core.DirContextProcessor; -import org.springframework.ldap.core.simple.ParameterizedContextMapper; -import org.springframework.ldap.core.simple.SimpleLdapTemplate; +import org.springframework.ldap.core.LdapTemplate; import org.springframework.ldap.filter.AndFilter; import org.springframework.ldap.filter.EqualsFilter; import org.springframework.ldap.itest.AbstractLdapTemplateIntegrationTest; @@ -31,12 +39,6 @@ import org.springframework.ldap.itest.NoAdTest; import org.springframework.ldap.support.LdapUtils; import org.springframework.test.context.ContextConfiguration; -import javax.naming.NamingException; -import javax.naming.directory.DirContext; -import javax.naming.directory.SearchControls; -import javax.naming.ldap.LdapName; -import java.util.List; - import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.fail; @@ -47,7 +49,7 @@ public class SimpleLdapTemplateITest extends AbstractLdapTemplateIntegrationTest private static LdapName DN = LdapUtils.newLdapName("cn=Some Person4,ou=company1,ou=Sweden"); @Autowired - private SimpleLdapTemplate ldapTemplate; + private LdapTemplate ldapTemplate; @Test public void testLookup() { @@ -125,7 +127,7 @@ public class SimpleLdapTemplateITest extends AbstractLdapTemplateIntegrationTest ldapTemplate.modifyAttributes(ctx); // verify that the data was properly updated. - ldapTemplate.lookup("cn=Some Person,ou=company1,ou=Sweden", new ParameterizedContextMapper() { + ldapTemplate.lookup("cn=Some Person,ou=company1,ou=Sweden", new ContextMapper() { public Object mapFromContext(Object ctx) { DirContextAdapter adapter = (DirContextAdapter) ctx; assertThat(adapter.getStringAttribute("description")).isEqualTo("updated description"); @@ -146,7 +148,7 @@ public class SimpleLdapTemplateITest extends AbstractLdapTemplateIntegrationTest ldapTemplate.modifyAttributes(ctx); // verify that the data was properly updated. - ldapTemplate.lookup("cn=Some Person,ou=company1,ou=Sweden", new ParameterizedContextMapper() { + ldapTemplate.lookup("cn=Some Person,ou=company1,ou=Sweden", new ContextMapper() { public Object mapFromContext(Object ctx) { DirContextAdapter adapter = (DirContextAdapter) ctx; assertThat(adapter.getStringAttribute("description")).isEqualTo("updated description"); @@ -219,7 +221,7 @@ public class SimpleLdapTemplateITest extends AbstractLdapTemplateIntegrationTest } } - private static final class CnContextMapper implements ParameterizedContextMapper { + private static final class CnContextMapper implements ContextMapper { public String mapFromContext(Object ctx) { DirContextAdapter adapter = (DirContextAdapter) ctx; diff --git a/test/integration-tests/src/test/java/org/springframework/ldap/itest/core/support/LdapContextSourceIntegrationTest.java b/test/integration-tests/src/test/java/org/springframework/ldap/itest/core/support/LdapContextSourceIntegrationTest.java index 5923195f..6ab7bf14 100644 --- a/test/integration-tests/src/test/java/org/springframework/ldap/itest/core/support/LdapContextSourceIntegrationTest.java +++ b/test/integration-tests/src/test/java/org/springframework/ldap/itest/core/support/LdapContextSourceIntegrationTest.java @@ -24,7 +24,7 @@ import org.springframework.dao.IncorrectResultSizeDataAccessException; import org.springframework.ldap.core.ContextSource; import org.springframework.ldap.core.DirContextOperations; import org.springframework.ldap.core.LdapTemplate; -import org.springframework.ldap.core.simple.AbstractParameterizedContextMapper; +import org.springframework.ldap.core.support.AbstractContextMapper; import org.springframework.ldap.core.support.LdapContextSource; import org.springframework.ldap.filter.EqualsFilter; import org.springframework.ldap.itest.AbstractLdapTemplateIntegrationTest; @@ -159,7 +159,7 @@ public class LdapContextSourceIntegrationTest extends AbstractLdapTemplateIntegr } } - private final static class DnContextMapper extends AbstractParameterizedContextMapper { + private final static class DnContextMapper extends AbstractContextMapper { @Override protected String doMapFromContext(DirContextOperations ctx) { return ctx.getNameInNamespace(); diff --git a/test/integration-tests/src/test/resources/conf/simpleLdapTemplateTestContext.xml b/test/integration-tests/src/test/resources/conf/simpleLdapTemplateTestContext.xml index 6147a7c4..e0f490f3 100644 --- a/test/integration-tests/src/test/resources/conf/simpleLdapTemplateTestContext.xml +++ b/test/integration-tests/src/test/resources/conf/simpleLdapTemplateTestContext.xml @@ -7,7 +7,7 @@ + class="org.springframework.ldap.core.LdapTemplate">