Skip to content

Commit f8f82a5

Browse files
author
Yury
authored
Fix Neo4j default password to support v5 (#832)
1 parent aedb386 commit f8f82a5

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

packages/modules/neo4j/src/neo4j-container.test.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,27 @@ describe("Neo4jContainer", () => {
2525
});
2626
// }
2727

28+
// v5DefaultPassword {
29+
it("should connect to neo4j:v5 with default password", async () => {
30+
const container = await new Neo4jContainer("neo4j:5.23.0").start();
31+
const driver = neo4j.driver(
32+
container.getBoltUri(),
33+
neo4j.auth.basic(container.getUsername(), container.getPassword())
34+
);
35+
36+
const session = driver.session();
37+
const personName = "Chris";
38+
const result = await session.run("CREATE (a:Person {name: $name}) RETURN a", { name: personName });
39+
const singleRecord = result.records[0];
40+
const node = singleRecord.get(0);
41+
expect(node.properties.name).toBe(personName);
42+
43+
await session.close();
44+
await driver.close();
45+
await container.stop();
46+
});
47+
// }
48+
2849
// setPassword {
2950
it("should connect with custom password", async () => {
3051
const container = await new Neo4jContainer().withPassword("xyz1234@!").start();

packages/modules/neo4j/src/neo4j-container.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const HTTP_PORT = 7474;
55
const USERNAME = "neo4j";
66

77
export class Neo4jContainer extends GenericContainer {
8-
private password = "test";
8+
private password = "pass123!@#WORD";
99
private apoc = false;
1010
private ttl?: number;
1111

0 commit comments

Comments
 (0)