Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
SDN 4.2 issue
@ContextConfiguration(classes = {GalaxyContext.class, MyConfig.class})
public class MyTest {
WorldRepository worldRepository;
@Test(expected = DataIntegrityViolationException.class)
public void shouldTrowRollbackException() throws Exception { World("Tatooine", 0)); World("Tatooine", 0));
public static class MyConfig {
public SessionFactory sessionFactory() {
org.neo4j.ogm.config.Configuration configuration = new org.neo4j.ogm.config.Configuration();
return new SessionFactory(configuration, "");
public Neo4jOperations neo4jOperations() {
Neo4jTemplate neo4jTemplate = new Neo4jTemplate(sessionFactory());
Map<String, Object> map = Collections.emptyMap();
neo4jTemplate.query("CREATE CONSTRAINT ON (w:World) ASSERT IS UNIQUE", map);
return neo4jTemplate;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment