Skip to content

add end to end tests for Neo4j heuristics, and the option that enables their instrumentation - #1773

Merged
arcuri82 merged 3 commits into
masterfrom
neo4j-e2e
Sep 22, 2026
Merged

arcuri82 merged 3 commits into
masterfrom
neo4j-e2e

Conversation

@andyfelder16

@andyfelder16 andyfelder16 commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator
  • instrumentMR_NEO4J added to EMConfig, experimental and off by default like the ones for Redis and DynamoDB, plus its entry in docs/options.md. It was missing: all the Neo4j method replacements belong to ReplacementCategory.NEO4J, which methodReplacementCategories() never listed, so no Cypher query was captured in an actual search
  • New module spring-rest-neo4j, following the structure of spring-rest-redis: a Testcontainers-based Neo4jController, and one App / Rest / controller / EMTest per scenario
  • Two scenarios, each with a POST that creates a node and a GET that returns 200 or 404 depending on whether a MATCH finds it: session runs its queries with Session.run, transaction runs them inside readTransaction(tx -> tx.run(...))
  • Each test asserts that the search reaches both the 404 and the 200 of the GET
  • Scenarios that need generated data will come with the data insertion PR

…4J switch and a spring-rest-neo4j e2e module covering session and transactional queries
@andyfelder16
andyfelder16 marked this pull request as ready for review September 17, 2026 14:29
@jgaleotti
jgaleotti requested a review from arcuri82 September 17, 2026 21:12
@RequestMapping(path = "/neo4jsessionfindnode")
public class Neo4jSessionFindNodeRest extends AbstractNeo4jRest {

@PostMapping("/person/{name}")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

based on Black-Box heuristics (not necessarely now, but in future) it could connect a POST:/person/{name} to a GET:/findPerson/{name}. To avoid this, and make more likely that finding the solution is for Neo4J heuristics and not something else, I would rename POST:/person/{name} into something like POST:/x/foo/{y}/bar

@@ -0,0 +1,37 @@
package com.neo4j;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this get confusing with the real org.neo4j. maybe call it com.foo.neo4j?


import org.springframework.context.annotation.Bean;
import org.springframework.web.context.request.WebRequest;
import springfox.documentation.builders.ApiInfoBuilder;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should not use springfox for new modules, but rather SpringDoc

@arcuri82
arcuri82 merged commit 5ee7977 into master Sep 22, 2026
54 checks passed
@arcuri82
arcuri82 deleted the neo4j-e2e branch September 22, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants