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 2fd2157 commit e0cbfee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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 @@ -9,7 +9,7 @@ import org.neo4j.logging.Log
import streams.events.*


private val PATTERN_REG: Regex = "^(\\s*\\:*\\s*\\`*\\s*\\w+\\s*(?:\\:*\\s*\\`*\\s*\\:?(?:[\\w\\`|\\*]+)\\s*)*\\`*\\:?)\\s*(?:\\{\\s*(-?[\\w|\\*]+\\s*(?:,\\s*-?[\\w|\\*]+\\s*)*)\\})?\$".toRegex()
private val PATTERN_REG: Regex = "^(\\s*\\:*\\s*\\`*\\s*[\\w-]+\\s*(?:\\:*\\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 @@ -157,12 +157,12 @@ 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)
assertEquals(RelKeyStrategy.DEFAULT, routing[0].relKeyStrategy)
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 e0cbfee

Please sign in to comment.