-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to run enterprise edition (#15)
* Add option to run enterprise edition * Show full path in error message * Update MSRV to 1.63.0 * Fix tests for latest neo4rs version * Update doc test for new password method
- Loading branch information
1 parent
f062360
commit f85e3b5
Showing
8 changed files
with
123 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
Cargo.lock | ||
.idea/ | ||
|
||
container-license-acceptance.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
use neo4j_testcontainers::Neo4j; | ||
use neo4rs::Graph; | ||
use testcontainers::clients::Cli; | ||
|
||
#[tokio::test] | ||
async fn runs_enterprise() { | ||
let neo4j = match Neo4j::default().with_enterprise_edition() { | ||
Ok(n) => n, | ||
Err(e) => { | ||
eprintln!( | ||
"Skipping enterprise test, no license acceptance file found: {}", | ||
e | ||
); | ||
return; | ||
} | ||
} | ||
.with_password("Picard123"); | ||
|
||
let docker = Cli::default(); | ||
let container = docker.run(neo4j); | ||
|
||
let image = container.image(); | ||
|
||
let uri = image.bolt_uri_ipv4(); | ||
assert!(uri.starts_with("bolt://")); | ||
|
||
let uri = image.http_uri_ipv4(); | ||
assert!(uri.starts_with("http://")); | ||
|
||
let uri = image.bolt_uri_ipv4(); | ||
let auth_user = image.user().expect("default user"); | ||
let auth_pass = image.password().expect("set password"); | ||
|
||
let graph = Graph::new(uri, auth_user, auth_pass).await.unwrap(); | ||
let mut result = graph | ||
.execute(neo4rs::query( | ||
"CALL dbms.components() YIELD edition RETURN edition", | ||
)) | ||
.await | ||
.unwrap(); | ||
let row = result.next().await.unwrap().unwrap(); | ||
let value: String = row.get("edition").unwrap(); | ||
assert_eq!(value, "enterprise"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters