DATALDAP-1 - Polishing.
Split XML configuration into infrastructure and test-specific parts. Add test logging configuration. Rename test classes to end with Tests suffix.
This commit is contained in:
@@ -42,7 +42,7 @@ import org.springframework.ldap.support.LdapUtils;
|
||||
/**
|
||||
* @author Mattias Hellborg Arthursson
|
||||
*/
|
||||
public class SimpleLdapRepositoryTest {
|
||||
public class SimpleLdapRepositoryTests {
|
||||
|
||||
private LdapOperations ldapOperationsMock;
|
||||
private ObjectDirectoryMapper odmMock;
|
||||
@@ -46,7 +46,7 @@ public class AnnotationConfigTests {
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@ImportResource("classpath:/ldap-annotation-config.xml")
|
||||
@ImportResource("classpath:/infrastructure.xml")
|
||||
@EnableLdapRepositories(basePackageClasses = DummyLdapRepository.class)
|
||||
static class Config {}
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
|
||||
* @author Mattias Hellborg Arthursson
|
||||
* @author Eddu Melendez
|
||||
*/
|
||||
@ContextConfiguration("classpath:/query-test.xml")
|
||||
public class PartTreeLdapRepositoryQueryTest extends AbstractJUnit4SpringContextTests {
|
||||
@ContextConfiguration
|
||||
public class PartTreeLdapRepositoryQueryTests extends AbstractJUnit4SpringContextTests {
|
||||
|
||||
@Autowired private LdapTemplate ldapTemplate;
|
||||
private Class<?> targetClass;
|
||||
@@ -29,7 +29,7 @@ import com.querydsl.core.types.Expression;
|
||||
* @author Mattias Hellborg Arthursson
|
||||
* @author Eddu Melendez
|
||||
*/
|
||||
public class QueryDslFilterGeneratorTest {
|
||||
public class QueryDslFilterGeneratorTests {
|
||||
|
||||
private LdapSerializer tested;
|
||||
private QPerson person;
|
||||
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ldap="http://www.springframework.org/schema/ldap"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/ldap http://www.springframework.org/schema/ldap/spring-ldap.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
|
||||
|
||||
<ldap:context-source password="apassword" url="ldap://localhost:389" username="uid=admin"/>
|
||||
|
||||
<ldap:ldap-template/>
|
||||
|
||||
<context:component-scan base-package="org.springframework.data.ldap.repository.config"/>
|
||||
|
||||
</beans>
|
||||
18
src/test/resources/logback.xml
Normal file
18
src/test/resources/logback.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d %5p %40.40c:%4L - %m%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!--
|
||||
<logger name="org.springframework" level="debug" />
|
||||
-->
|
||||
|
||||
<root level="error">
|
||||
<appender-ref ref="console" />
|
||||
</root>
|
||||
|
||||
</configuration>
|
||||
1
src/test/resources/logging.properties
Normal file
1
src/test/resources/logging.properties
Normal file
@@ -0,0 +1 @@
|
||||
handlers = org.slf4j.bridge.SLF4JBridgeHandler
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:data-ldap="http://www.springframework.org/schema/data/ldap"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/data/ldap http://www.springframework.org/schema/data/ldap/spring-ldap.xsd
|
||||
">
|
||||
|
||||
<import resource="classpath:infrastructure.xml"/>
|
||||
|
||||
<data-ldap:repositories base-package="org.springframework.ldap.repository.query"/>
|
||||
|
||||
</beans>
|
||||
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ldap="http://www.springframework.org/schema/ldap"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/ldap http://www.springframework.org/schema/ldap/spring-ldap.xsd">
|
||||
|
||||
<ldap:context-source url="ldap://localhost:389"
|
||||
username="cn=Admin"
|
||||
password="secret" />
|
||||
<ldap:ldap-template />
|
||||
|
||||
<ldap:repositories base-package="org.springframework.ldap.repository.query" />
|
||||
|
||||
</beans>
|
||||
Reference in New Issue
Block a user