Skip to content

test: add integration tests for pattern sink handlers#120

Merged
ali-ince merged 17 commits intoneo4j:mainfrom
ali-ince:test-pattern-strategies
Jun 10, 2024
Merged

test: add integration tests for pattern sink handlers#120
ali-ince merged 17 commits intoneo4j:mainfrom
ali-ince:test-pattern-strategies

Conversation

@ali-ince
Copy link
Contributor

This PR;

  • adds integration tests for both node and pattern sink handlers,
  • refactors pattern sink handlers to use constants during cypher generation,
  • removes old pattern parser logic and uses the new parser for legacy handlers too.

Based on #116

@ali-ince ali-ince requested a review from a team as a code owner May 21, 2024 15:29

@Neo4jSink(nodePattern = [NodePatternStrategy(TOPIC, "(:User{!id})", false)])
@Test
fun `should create and delete node in the same kafka transaction`(
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm afraid this test is not checking much. It's challenging to verify that nothing happened :) I think the eventual condition will kick in on the first attempt. I suspect you can comment out the publish and the test will still pass.

I can suggest inserting the user in some default condition before. In that case, the first message should be able to update it and the second will delete it.

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

Choose a reason for hiding this comment

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

I changed this to a test that only checks deletion of existing data in db.

Copy link
Contributor

@venikkin venikkin left a comment

Choose a reason for hiding this comment

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

I think my suggestion from the previous review is minor, so approving here.

@ali-ince ali-ince enabled auto-merge (squash) June 10, 2024 16:59
@ali-ince ali-ince merged commit d7b137a into neo4j:main Jun 10, 2024
@ali-ince ali-ince deleted the test-pattern-strategies branch July 2, 2024 11:34
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.

4 participants