Skip to content

Commit

Permalink
Fixes neo4j-contrib#487: Neo4j Stream plugin (Source) error when hyph…
Browse files Browse the repository at this point in the history
…en character in relationship name
  • Loading branch information
mroiter-larus committed Sep 1, 2021
1 parent 943e473 commit c1614ce
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ Thumbs.db
.cache-main
.cache-tests
bin
doc/node
doc/node_modules
2 changes: 1 addition & 1 deletion producer/src/main/kotlin/streams/RoutingConfiguration.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import org.neo4j.graphdb.Relationship
import streams.events.*


private val PATTERN_REG: Regex = "^(\\w+\\s*(?::\\s*(?:[\\w|\\*]+)\\s*)*)\\s*(?:\\{\\s*(-?[\\w|\\*]+\\s*(?:,\\s*-?[\\w|\\*]+\\s*)*)\\})?\$".toRegex()
private val PATTERN_REG: Regex = "^([\\w-]+\\s*(?::\\s*(?:[\\w-|\\*]+)\\s*)*)\\s*(?:\\{\\s*(-?[\\w-|\\*]+\\s*(?:,\\s*-?[\\w-|\\*]+\\s*)*)\\})?\$".toRegex()
private val PATTERN_COLON_REG = "\\s*:\\s*".toRegex()
private val PATTERN_COMMA = "\\s*,\\s*".toRegex()
private const val PATTERN_WILDCARD = "*"
Expand Down
4 changes: 2 additions & 2 deletions producer/src/test/kotlin/streams/RoutingConfigurationTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ class RoutingConfigurationTest {
assertTrue { routing[0].include.isEmpty() }
assertTrue { routing[0].exclude.isEmpty() }

routing = RoutingConfigurationFactory.getRoutingConfiguration("topic4", "KNOWS;LOVES{p1, p2}", EntityType.relationship) as List<RelationshipRoutingConfiguration>
routing = RoutingConfigurationFactory.getRoutingConfiguration("topic4", "BELONGS-TO;LOVES{p1, p2}", EntityType.relationship) as List<RelationshipRoutingConfiguration>
assertEquals(2, routing.size)
assertEquals("topic4", routing[0].topic)
assertTrue { routing[0].all }
assertEquals("KNOWS",routing[0].name)
assertEquals("BELONGS-TO",routing[0].name)
assertTrue { routing[0].include.isEmpty() }
assertTrue { routing[0].exclude.isEmpty() }
assertEquals("topic4", routing[1].topic)
Expand Down

0 comments on commit c1614ce

Please sign in to comment.