Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public class AzuriteContainer extends GenericContainer<AzuriteContainer> {
private MountableFile key = null;

private String pwd = null;
private boolean ignoreApiVersionCheck = false;

/**
* @param dockerImageName specified docker image name to run
Expand Down Expand Up @@ -82,6 +83,7 @@ public AzuriteContainer withSsl(final MountableFile pfxCert, final String passwo
return this;
}


/**
* Configure SSL with a custom certificate and private key.
*
Expand All @@ -96,6 +98,20 @@ public AzuriteContainer withSsl(final MountableFile pemCert, final MountableFile
return this;
}


/**
* Configure the container to ignore version checks.
* This is useful as Azure SDK update are more frequent than Azurite releases.
*
* @param ignore true to ignore version checks, false otherwise, default is false
* @return this
*/
public AzuriteContainer withIgnoreApiVersionCheck(boolean ignore) {
this.ignoreApiVersionCheck = ignore;
return this;
}


@Override
protected void configure() {
withCommand(getCommandLine());
Expand Down Expand Up @@ -152,6 +168,9 @@ String getCommandLine() {
args.append(" --blobHost ").append(ALLOW_ALL_CONNECTIONS);
args.append(" --queueHost ").append(ALLOW_ALL_CONNECTIONS);
args.append(" --tableHost ").append(ALLOW_ALL_CONNECTIONS);
if (this.ignoreApiVersionCheck) {
args.append(" --skipApiVersionCheck");
}
if (this.cert != null) {
args.append(" --cert ").append("/cert").append(this.certExtension);
if (this.pwd != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,26 @@ void testWithTableServiceClientWithSslUsingPem() {
}
}

@Test
void testWithIgnoreApiVersionCheckAloneAndWithSsl() {
AzuriteContainer withoutSsl = new AzuriteContainer("mcr.microsoft.com/azure-storage/azurite:3.33.0")
.withIgnoreApiVersionCheck(true);

assertThat(withoutSsl.getCommandLine())
.contains("--skipApiVersionCheck")
.doesNotContain("--cert")
.doesNotContain("--key");

AzuriteContainer withSsl = new AzuriteContainer("mcr.microsoft.com/azure-storage/azurite:3.33.0")
.withIgnoreApiVersionCheck(true)
.withSsl(MountableFile.forClasspathResource("/keystore.pfx"), PASSWORD);

assertThat(withSsl.getCommandLine())
.contains("--skipApiVersionCheck")
.contains("--cert /cert.pfx")
.contains("--pwd " + PASSWORD);
}

@Test
void testTwoAccountKeysWithBlobServiceClient() {
try (
Expand Down