maku_at
maku_at

Reputation: 1687

How to do integration test in spring data neo4j (SDN4)

I want to write integration tests in a project which uses spring data neo4j version 4 (SDN4) in context of a spring boot application.

Does anybody know how to do that?

Upvotes: 2

Views: 1900

Answers (2)

Vince
Vince

Reputation: 2181

Your integration tests can use a mocking framework such as Spring's MockMvc to avoid the need to start up a web container. If you don't want them to run in a web context at all you can use a different configuration file for testing that doesn't specify a session-scoped bean.

The integration tests in the SDN 4 codebase take both of these approaches.

https://github.com/spring-projects/spring-data-neo4j/tree/4.0/spring-data-neo4j/src/test/java/org/springframework/data/neo4j/integration

Upvotes: 2

Luanne
Luanne

Reputation: 19373

The Cineasts example application for SDN4 has tests here: https://github.com/neo4j-examples/sdn4-cineasts/tree/master/src/test/java/org/neo4j/cineasts

Hope that helps.

Upvotes: 4

Related Questions