Viewing a query in the embedded Neo4j database

I want the query to be executed by the Neo4j embedded database using spring data in a JUnit test. How can i do this?

+4
source share
2 answers

I use slf4j along with log4j to list the console in my junit test cases. By entering the following logger configuration into the log4j.xml file, I get more detailed output for the spring -data-neo4j part:

<logger name="org.springframework.data"> <level value="debug" /> </logger> <logger name="org.springframework.persistence"> <level value="debug" /> </logger> 

The output contains detailed information about the requests received, for example. from repositories:

 23.08.2013 09:22:27 DEBUG DerivedCypherRepositoryQuery - Derived query: START `document`=node({0}) WHERE (has(`document`.__type__) AND `document`.__type__ IN ['my.package.Document']) RETURN `document`from method Repository-Graph-Query-Method for public abstract my.package.Document my.package.repositories.DocumentRepository.getDocumentByDocumentId(java.lang.Long) 
0
source
 <logger name="org.springframework.data.neo4j"> <level value="debug"/> </logger> 
0
source

Source: https://habr.com/ru/post/1490331/


All Articles