-
-
Notifications
You must be signed in to change notification settings - Fork 287
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add Neo4j Enterprise Edition support (`WithEnterpriseEdition(bo…
…ol)`) (#1269) Co-authored-by: Andre Hofmeister <[email protected]>
- Loading branch information
1 parent
0b8b34b
commit e96d4e6
Showing
6 changed files
with
188 additions
and
8 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
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 |
---|---|---|
@@ -1,6 +1,10 @@ | ||
global using System; | ||
global using System.Linq; | ||
global using System.Text.RegularExpressions; | ||
global using Docker.DotNet.Models; | ||
global using DotNet.Testcontainers; | ||
global using DotNet.Testcontainers.Builders; | ||
global using DotNet.Testcontainers.Configurations; | ||
global using DotNet.Testcontainers.Containers; | ||
global using DotNet.Testcontainers.Images; | ||
global using JetBrains.Annotations; |
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,50 @@ | ||
namespace Testcontainers.Neo4j; | ||
|
||
public sealed class Neo4jBuilderTest | ||
{ | ||
[Theory] | ||
[Trait(nameof(DockerCli.DockerPlatform), nameof(DockerCli.DockerPlatform.Linux))] | ||
[InlineData("neo4j:5.23.0", "5.23.0-enterprise")] | ||
[InlineData("neo4j:5.23", "5.23-enterprise")] | ||
[InlineData("neo4j:5", "5-enterprise")] | ||
[InlineData("neo4j:5.23.0-community", "5.23.0-community")] | ||
[InlineData("neo4j:5.23-community", "5.23-community")] | ||
[InlineData("neo4j:5-community", "5-community")] | ||
[InlineData("neo4j:community", "community")] | ||
[InlineData("neo4j:5.23.0-bullseye", "5.23.0-enterprise-bullseye")] | ||
[InlineData("neo4j:5.23-bullseye", "5.23-enterprise-bullseye")] | ||
[InlineData("neo4j:5-bullseye", "5-enterprise-bullseye")] | ||
[InlineData("neo4j:bullseye", "enterprise-bullseye")] | ||
[InlineData("neo4j:5.23.0-enterprise-bullseye", "5.23.0-enterprise-bullseye")] | ||
[InlineData("neo4j:5.23-enterprise-bullseye", "5.23-enterprise-bullseye")] | ||
[InlineData("neo4j:5-enterprise-bullseye", "5-enterprise-bullseye")] | ||
[InlineData("neo4j:enterprise-bullseye", "enterprise-bullseye")] | ||
[InlineData("neo4j:5.23.0-enterprise", "5.23.0-enterprise")] | ||
[InlineData("neo4j:5.23-enterprise", "5.23-enterprise")] | ||
[InlineData("neo4j:5-enterprise", "5-enterprise")] | ||
[InlineData("neo4j:enterprise", "enterprise")] | ||
[InlineData("neo4j", "enterprise")] | ||
[InlineData("neo4j@sha256:20eb19e3d60f9f07c12c89eac8d8722e393be7e45c6d7e56004a2c493b8e2032", null)] | ||
public void AppendsEnterpriseSuffixWhenEnterpriseEditionLicenseAgreementIsAccepted(string image, string expected) | ||
{ | ||
var neo4jContainer = new Neo4jBuilder().WithImage(image).WithEnterpriseEdition(true).Build(); | ||
Assert.Equal(expected, neo4jContainer.Image.Tag); | ||
} | ||
|
||
[Theory] | ||
[Trait(nameof(DockerCli.DockerPlatform), nameof(DockerCli.DockerPlatform.Linux))] | ||
[ClassData(typeof(Neo4jBuilderConfigurations))] | ||
public void ThrowsArgumentExceptionWhenEnterpriseEditionLicenseAgreementIsNotAccepted(Neo4jBuilder neo4jBuilder) | ||
{ | ||
Assert.Throws<ArgumentException>(neo4jBuilder.Build); | ||
} | ||
|
||
private sealed class Neo4jBuilderConfigurations : TheoryData<Neo4jBuilder> | ||
{ | ||
public Neo4jBuilderConfigurations() | ||
{ | ||
Add(new Neo4jBuilder().WithImage(Neo4jBuilder.Neo4jImage + "-enterprise")); | ||
Add(new Neo4jBuilder().WithEnterpriseEdition(false)); | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
global using System; | ||
global using System.Threading.Tasks; | ||
global using DotNet.Testcontainers.Commons; | ||
global using JetBrains.Annotations; | ||
global using Neo4j.Driver; | ||
global using Xunit; |