Skip to content

Commit

Permalink
Fix Neo4j default password to support v5 (#832)
Browse files Browse the repository at this point in the history
  • Loading branch information
EcksDy authored Sep 10, 2024
1 parent aedb386 commit f8f82a5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
21 changes: 21 additions & 0 deletions packages/modules/neo4j/src/neo4j-container.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,27 @@ describe("Neo4jContainer", () => {
});
// }

// v5DefaultPassword {
it("should connect to neo4j:v5 with default password", async () => {
const container = await new Neo4jContainer("neo4j:5.23.0").start();
const driver = neo4j.driver(
container.getBoltUri(),
neo4j.auth.basic(container.getUsername(), container.getPassword())
);

const session = driver.session();
const personName = "Chris";
const result = await session.run("CREATE (a:Person {name: $name}) RETURN a", { name: personName });
const singleRecord = result.records[0];
const node = singleRecord.get(0);
expect(node.properties.name).toBe(personName);

await session.close();
await driver.close();
await container.stop();
});
// }

// setPassword {
it("should connect with custom password", async () => {
const container = await new Neo4jContainer().withPassword("xyz1234@!").start();
Expand Down
2 changes: 1 addition & 1 deletion packages/modules/neo4j/src/neo4j-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const HTTP_PORT = 7474;
const USERNAME = "neo4j";

export class Neo4jContainer extends GenericContainer {
private password = "test";
private password = "pass123!@#WORD";
private apoc = false;
private ttl?: number;

Expand Down

0 comments on commit f8f82a5

Please sign in to comment.