Skip to content

Commit 6e5550c

Browse files
authored
Merge pull request #509 from Aiven-Open/ivanyu/azurite-no-https
Remove HTTPS from Azure tests
2 parents 97d28fb + a35cded commit 6e5550c

File tree

6 files changed

+3
-73
lines changed

6 files changed

+3
-73
lines changed

storage/azure/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageMetricsTest.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,6 @@ public class AzureBlobStorageMetricsTest {
6666

6767
@BeforeAll
6868
static void setUpClass() {
69-
// Generally setting JVM-wide trust store needed only for one test may be not OK,
70-
// but it's not conflicting with any other test now and this is the most straightforward way
71-
// to make the self-signed certificate work.
72-
System.setProperty("javax.net.ssl.trustStore",
73-
AzureBlobStorageMetricsTest.class.getResource("/azurite-cacerts.jks").getPath());
74-
System.setProperty("javax.net.ssl.trustStorePassword", "changeit");
7569
blobServiceClient = new BlobServiceClientBuilder()
7670
.connectionString(connectionString(AZURITE_SERVER, BLOB_STORAGE_PORT))
7771
.buildClient();

storage/azure/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/azure/AzureBlobStorageTest.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,6 @@ abstract class AzureBlobStorageTest extends BaseStorageTest {
4848

4949
@BeforeAll
5050
static void setUpClass() {
51-
// Generally setting JVM-wide trust store needed only for one test may be not OK,
52-
// but it's not conflicting with any other test now and this is the most straightforward way
53-
// to make the self-signed certificate work.
54-
System.setProperty("javax.net.ssl.trustStore",
55-
AzureBlobStorageTest.class.getResource("/azurite-cacerts.jks").getPath());
56-
System.setProperty("javax.net.ssl.trustStorePassword", "changeit");
5751
blobServiceClient = new BlobServiceClientBuilder()
5852
.connectionString(connectionString(AZURITE_SERVER, BLOB_STORAGE_PORT))
5953
.buildClient();

storage/azure/src/integration-test/java/io/aiven/kafka/tieredstorage/storage/azure/AzuriteBlobStorageUtils.java

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,23 @@
1818

1919
import org.testcontainers.containers.GenericContainer;
2020
import org.testcontainers.utility.DockerImageName;
21-
import org.testcontainers.utility.MountableFile;
2221

2322
public class AzuriteBlobStorageUtils {
2423
static GenericContainer<?> azuriteContainer(final int port) {
2524
return
2625
new GenericContainer<>(DockerImageName.parse("mcr.microsoft.com/azure-storage/azurite"))
27-
.withCopyFileToContainer(
28-
MountableFile.forClasspathResource("/azurite-cert.pem"),
29-
"/opt/azurite/azurite-cert.pem")
30-
.withCopyFileToContainer(
31-
MountableFile.forClasspathResource("/azurite-key.pem"),
32-
"/opt/azurite/azurite-key.pem")
3326
.withExposedPorts(port)
34-
.withCommand("azurite-blob --blobHost 0.0.0.0 "
35-
+ "--cert /opt/azurite/azurite-cert.pem --key /opt/azurite/azurite-key.pem");
27+
.withCommand("azurite-blob --blobHost 0.0.0.0");
3628
}
3729

3830

3931
static String endpoint(final GenericContainer<?> azuriteContainer, final int port) {
40-
return "https://127.0.0.1:" + azuriteContainer.getMappedPort(port) + "/devstoreaccount1";
32+
return "http://127.0.0.1:" + azuriteContainer.getMappedPort(port) + "/devstoreaccount1";
4133
}
4234

4335
static String connectionString(final GenericContainer<?> azuriteContainer, final int port) {
4436
// The well-known Azurite connection string.
45-
return "DefaultEndpointsProtocol=https;"
37+
return "DefaultEndpointsProtocol=http;"
4638
+ "AccountName=devstoreaccount1;"
4739
+ "AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;"
4840
+ "BlobEndpoint=" + endpoint(azuriteContainer, port) + ";";
-1.24 KB
Binary file not shown.

storage/azure/src/integration-test/resources/azurite-cert.pem

Lines changed: 0 additions & 22 deletions
This file was deleted.

storage/azure/src/integration-test/resources/azurite-key.pem

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)