added test for automatic index creation of non-default indexes
This commit is contained in:
@@ -30,6 +30,9 @@
|
||||
<bean id="graphDatabaseService" class="org.neo4j.test.ImpermanentGraphDatabase" destroy-method="shutdown" scope="singleton"/>
|
||||
|
||||
<bean id="conversionService" class="org.springframework.data.neo4j.fieldaccess.Neo4jConversionServiceFactoryBean"/>
|
||||
<bean id="indexCreationMappingEventListener" class="org.springframework.data.neo4j.support.mapping.IndexCreationMappingEventListener">
|
||||
<constructor-arg ref="template"/>
|
||||
</bean>
|
||||
|
||||
|
||||
<bean id="mappingInfrastructure" class="org.springframework.data.neo4j.support.MappingInfrastructureFactoryBean">
|
||||
|
||||
@@ -29,6 +29,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.neo4j.conversion.EndResult;
|
||||
import org.springframework.data.neo4j.model.Group;
|
||||
import org.springframework.data.neo4j.model.Person;
|
||||
import org.springframework.test.context.CleanContextCacheTestExecutionListener;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
@@ -49,6 +50,8 @@ public class NoIndexDerivedFinderTest {
|
||||
|
||||
@Autowired
|
||||
private PersonRepository personRepository;
|
||||
@Autowired
|
||||
private GroupRepository groupRepository;
|
||||
|
||||
@Test @Transactional
|
||||
public void findByAge() {
|
||||
@@ -62,6 +65,12 @@ public class NoIndexDerivedFinderTest {
|
||||
assertEquals(0,IteratorUtil.count( result ));
|
||||
}
|
||||
|
||||
@Test @Transactional
|
||||
public void findFullTextWithoutIndexCreation() {
|
||||
Iterable<Group> result = groupRepository.findByFullTextNameLike( "foo" );
|
||||
assertEquals(0,IteratorUtil.count( result ));
|
||||
}
|
||||
|
||||
@Test @Transactional
|
||||
public void findByName() {
|
||||
Iterable<Person> result = personRepository.findByName("");
|
||||
|
||||
Reference in New Issue
Block a user