|
9 | 9 | import n10s.nsprefixes.NsPrefixDefProcedures;
|
10 | 10 | import org.junit.Rule;
|
11 | 11 | import org.junit.Test;
|
12 |
| -import org.neo4j.driver.Config; |
13 |
| -import org.neo4j.driver.Driver; |
14 |
| -import org.neo4j.driver.GraphDatabase; |
| 12 | +import org.neo4j.driver.*; |
15 | 13 | import org.neo4j.driver.Record;
|
16 |
| -import org.neo4j.driver.Result; |
17 |
| -import org.neo4j.driver.Session; |
18 | 14 | import org.neo4j.harness.junit.rule.Neo4jRule;
|
19 | 15 |
|
20 | 16 | public class MappingUtilsTest {
|
@@ -197,4 +193,26 @@ public void testDropMappingsAndSchemas() throws Exception {
|
197 | 193 | }
|
198 | 194 | }
|
199 | 195 |
|
| 196 | + @Test |
| 197 | + public void testBug12931() throws Exception { |
| 198 | + try (Driver driver = GraphDatabase.driver(neo4j.boltURI(), |
| 199 | + Config.builder().withoutEncryption().build()); Session session = driver.session();) { |
| 200 | + String step1 = "CALL n10s.nsprefixes.add(\"a\",\"neo4j://vocs/a/\")"; |
| 201 | + String step2 = "CALL n10s.mapping.add(\"neo4j://vocs/a/something\",\"something\")"; |
| 202 | + String step3 = "CALL n10s.mapping.add(\"neo4j://vocs/a/other\",\"other\")"; |
| 203 | + String step4 = "CALL n10s.mapping.add(\"neo4j://vocs/a/something\",\"somethingElse\")"; |
| 204 | + |
| 205 | + session.run(step1); |
| 206 | + session.run(step2); |
| 207 | + session.run(step3); |
| 208 | + session.run(step4); |
| 209 | + |
| 210 | + assertEquals(2L,session.run("call n10s.mapping.list() yield schemaElement\n" + |
| 211 | + "return count(*) as mappingcount").next().get("mappingcount").asLong()); |
| 212 | + assertEquals(1L,session.run("call n10s.nsprefixes.list() yield namespace\n" + |
| 213 | + "return count(*) as namespacecount").next().get("namespacecount").asLong()); |
| 214 | + |
| 215 | + } |
| 216 | + |
| 217 | + } |
200 | 218 | }
|
0 commit comments