Skip to content

Commit 3b8a16d

Browse files
committed
test: Enable GCP blob store conformance tests testDownloadWithKmsKey, testUploadWithKmsKey_happyPath, testUploadWithKmsKey_emptyKmsKeyId, testUploadWithKmsKey_nullKmsKeyId, testRangedReadWithKmsKey, testVersionedCopyFrom
1 parent e355c22 commit 3b8a16d

File tree

79 files changed

+2292
-39
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+2292
-39
lines changed

blob/blob-client/src/test/java/com/salesforce/multicloudj/blob/client/AbstractBlobStoreIT.java

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
import java.util.ArrayList;
5656
import java.util.Arrays;
5757
import java.util.Collection;
58+
import java.util.Collections;
5859
import java.util.HashMap;
5960
import java.util.HashSet;
6061
import java.util.Iterator;
@@ -94,6 +95,10 @@ public interface Harness extends AutoCloseable {
9495

9596
// Returns the KMS key ID for encryption tests (provider-specific)
9697
String getKmsKeyId();
98+
99+
default List<String> getWiremockExtensions() {
100+
return Collections.emptyList();
101+
}
97102
}
98103

99104
protected abstract Harness createHarness();
@@ -108,7 +113,9 @@ public interface Harness extends AutoCloseable {
108113
@BeforeAll
109114
public void initializeWireMockServer() {
110115
harness = createHarness();
111-
TestsUtil.startWireMockServer("src/test/resources", harness.getPort());
116+
List<String> extensions = harness.getWiremockExtensions();
117+
TestsUtil.startWireMockServer("src/test/resources", harness.getPort(),
118+
extensions.toArray(new String[0]));
112119
}
113120

114121
/**
@@ -146,8 +153,8 @@ public void testNonexistentBucket() {
146153
// And run the tests given the non-existent bucket
147154
runOperationsThatShouldFail("testNonexistentBucket", bucketClient);
148155
if (!GCP_PROVIDER_ID.equals(harness.getProviderId())) {
149-
runOperationsThatShouldNotFail("testNonexistentBucket", bucketClient);
150-
}
156+
runOperationsThatShouldNotFail("testNonexistentBucket", bucketClient);
157+
}
151158
}
152159

153160
@Test
@@ -160,8 +167,8 @@ public void testInvalidCredentials() {
160167
// And run the tests given the invalid credentialsOverrider
161168
runOperationsThatShouldFail("testInvalidCredentials", bucketClient);
162169
if (!GCP_PROVIDER_ID.equals(harness.getProviderId())) {
163-
runOperationsThatShouldNotFail("testInvalidCredentials", bucketClient);
164-
}
170+
runOperationsThatShouldNotFail("testInvalidCredentials", bucketClient);
171+
}
165172
}
166173

167174
private void runOperationsThatShouldFail(String testName, BucketClient bucketClient) {
@@ -871,7 +878,6 @@ public TestConfig(String testName, Collection<String> keysToCreate, Collection<S
871878

872879
@Test
873880
public void testVersionedDelete_fileDoesNotExist() throws IOException {
874-
875881
// Create the BucketClient
876882
AbstractBlobStore blobStore = harness.createBlobStore(true, true, true);
877883
BucketClient bucketClient = new BucketClient(blobStore);
@@ -1356,8 +1362,6 @@ public void testCopyFrom() throws IOException {
13561362

13571363
@Test
13581364
public void testVersionedCopyFrom() throws IOException {
1359-
Assumptions.assumeFalse(GCP_PROVIDER_ID.equals(harness.getProviderId()));
1360-
13611365
String key = "conformance-tests/versionedCopyFrom/blob";
13621366
String destKeyV1 = "conformance-tests/versionedCopyFrom/copied-from-blob-v1";
13631367
String destKeyV2 = "conformance-tests/versionedCopyFrom/copied-from-blob-v2";
@@ -2737,22 +2741,19 @@ private void safeDeleteBlobs(BucketClient bucketClient, String... keys){
27372741

27382742
@Test
27392743
public void testUploadWithKmsKey_happyPath() {
2740-
Assumptions.assumeFalse(GCP_PROVIDER_ID.equals(harness.getProviderId()));
27412744
String key = "conformance-tests/kms/upload-happy-path";
27422745
String kmsKeyId = harness.getKmsKeyId();
27432746
runUploadWithKmsKeyTest(key, kmsKeyId, "Test data with KMS encryption".getBytes());
27442747
}
27452748

27462749
@Test
27472750
public void testUploadWithKmsKey_nullKmsKeyId() {
2748-
Assumptions.assumeFalse(GCP_PROVIDER_ID.equals(harness.getProviderId()));
27492751
String key = "conformance-tests/kms/upload-null-key";
27502752
runUploadWithKmsKeyTest(key, null, "Test data without KMS".getBytes());
27512753
}
27522754

27532755
@Test
27542756
public void testUploadWithKmsKey_emptyKmsKeyId() {
2755-
Assumptions.assumeFalse(GCP_PROVIDER_ID.equals(harness.getProviderId()));
27562757
String key = "conformance-tests/kms/upload-empty-key";
27572758
runUploadWithKmsKeyTest(key, "", "Test data with empty KMS key".getBytes());
27582759
}
@@ -2795,7 +2796,6 @@ private void runUploadWithKmsKeyTest(String key, String kmsKeyId, byte[] content
27952796

27962797
@Test
27972798
public void testDownloadWithKmsKey() throws IOException {
2798-
Assumptions.assumeFalse(GCP_PROVIDER_ID.equals(harness.getProviderId()));
27992799
String key = "conformance-tests/kms/download-happy-path";
28002800
String kmsKeyId = harness.getKmsKeyId();
28012801
byte[] content = "Test data for KMS download".getBytes(StandardCharsets.UTF_8);
@@ -2833,7 +2833,6 @@ public void testDownloadWithKmsKey() throws IOException {
28332833

28342834
@Test
28352835
public void testRangedReadWithKmsKey() throws IOException {
2836-
Assumptions.assumeFalse(GCP_PROVIDER_ID.equals(harness.getProviderId()));
28372836
String key = "conformance-tests/kms/ranged-read";
28382837
String kmsKeyId = harness.getKmsKeyId();
28392838
runRangedReadWithKmsKeyTest(key, kmsKeyId);

blob/blob-gcp/src/test/java/com/salesforce/multicloudj/blob/gcp/GcpBlobStoreIT.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import java.io.IOException;
1919
import java.net.URI;
20+
import java.util.List;
2021
import java.util.concurrent.ThreadLocalRandom;
2122

2223
public class GcpBlobStoreIT extends AbstractBlobStoreIT {
@@ -114,6 +115,11 @@ public String getKmsKeyId() {
114115
return "projects/substrate-sdk-gcp-poc1/locations/us/keyRings/chameleon-test/cryptoKeys/chameleon-test";
115116
}
116117

118+
public List<String> getWiremockExtensions() {
119+
// return List.of("com.salesforce.multicloudj.blob.gcp.util.ResumableUploadIdTransformer");
120+
return List.of();
121+
}
122+
117123
@Override
118124
public void close() {
119125
try {
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"id" : "60844984-a8b9-4cd4-b418-45c1586b26bd",
3+
"name" : "storage_v1_b_substrate-sdk-gcp-poc1-test-bucket_o_conformance-tests_kms_upload-null-key",
4+
"request" : {
5+
"url" : "/storage/v1/b/substrate-sdk-gcp-poc1-test-bucket/o/conformance-tests%2Fkms%2Fupload-null-key",
6+
"method" : "DELETE"
7+
},
8+
"response" : {
9+
"status" : 204,
10+
"headers" : {
11+
"Alt-Svc" : "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000",
12+
"Server" : "UploadServer",
13+
"Cache-Control" : "no-cache, no-store, max-age=0, must-revalidate",
14+
"X-GUploader-UploadID" : "AJRbA5XDGRbsVADVmgfZ3LX79tR5merQ4YeK7o0juDNjaBe6nwqTJP5SIO_HfUpiC7Tj0xaq0i481isJTCw1Lg",
15+
"Vary" : [ "Origin", "X-Origin" ],
16+
"Pragma" : "no-cache",
17+
"Expires" : "Mon, 01 Jan 1990 00:00:00 GMT",
18+
"Date" : "Fri, 09 Jan 2026 19:04:11 GMT",
19+
"Content-Type" : "application/json"
20+
}
21+
},
22+
"uuid" : "60844984-a8b9-4cd4-b418-45c1586b26bd",
23+
"persistent" : true,
24+
"insertionIndex" : 883
25+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"id" : "5a815df1-7f73-4f51-8333-357ddd5e79fd",
3+
"name" : "storage_v1_b_substrate-sdk-gcp-poc1-test-bucket_o_conformance-tests_kms_download-happy-path",
4+
"request" : {
5+
"url" : "/storage/v1/b/substrate-sdk-gcp-poc1-test-bucket/o/conformance-tests%2Fkms%2Fdownload-happy-path",
6+
"method" : "DELETE"
7+
},
8+
"response" : {
9+
"status" : 204,
10+
"headers" : {
11+
"Alt-Svc" : "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000",
12+
"Server" : "UploadServer",
13+
"Cache-Control" : "no-cache, no-store, max-age=0, must-revalidate",
14+
"X-GUploader-UploadID" : "AJRbA5VZdhBqKz2ZskADIK4a3yifJaLI2OmjFZd3vUpz-vocp5uWk9Lue3exUm4ZqRI6n0fCotkujr6XGUX5BQ",
15+
"Vary" : [ "Origin", "X-Origin" ],
16+
"Pragma" : "no-cache",
17+
"Expires" : "Mon, 01 Jan 1990 00:00:00 GMT",
18+
"Date" : "Fri, 09 Jan 2026 19:03:33 GMT",
19+
"Content-Type" : "application/json"
20+
}
21+
},
22+
"uuid" : "5a815df1-7f73-4f51-8333-357ddd5e79fd",
23+
"persistent" : true,
24+
"insertionIndex" : 862
25+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"id" : "8428bc86-256f-4221-a089-2d0d144bf523",
3+
"name" : "storage_v1_b_substrate-sdk-gcp-poc1-test-bucket-versioned_o_conformance-tests_versionedcopyfrom_copied-from-blob-latest",
4+
"request" : {
5+
"url" : "/storage/v1/b/substrate-sdk-gcp-poc1-test-bucket-versioned/o/conformance-tests%2FversionedCopyFrom%2Fcopied-from-blob-latest",
6+
"method" : "DELETE"
7+
},
8+
"response" : {
9+
"status" : 204,
10+
"headers" : {
11+
"Alt-Svc" : "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000",
12+
"Server" : "UploadServer",
13+
"Cache-Control" : "no-cache, no-store, max-age=0, must-revalidate",
14+
"X-GUploader-UploadID" : "AJRbA5XPfu7yGZ6KjqyD7U82MBa-b5Cu-iAaEpagYlKBLrvpa0vlkSucsEYn_lMEbfLs0Fh6_z1oLQEJl1RocQ",
15+
"Vary" : [ "Origin", "X-Origin" ],
16+
"Pragma" : "no-cache",
17+
"Expires" : "Mon, 01 Jan 1990 00:00:00 GMT",
18+
"Date" : "Fri, 09 Jan 2026 19:04:44 GMT",
19+
"Content-Type" : "application/json"
20+
}
21+
},
22+
"uuid" : "8428bc86-256f-4221-a089-2d0d144bf523",
23+
"persistent" : true,
24+
"insertionIndex" : 903
25+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"id" : "3d03e1e3-6e02-4d8e-aa5e-8621e48c12cf",
3+
"name" : "storage_v1_b_substrate-sdk-gcp-poc1-test-bucket_o_conformance-tests_kms_upload-empty-key",
4+
"request" : {
5+
"url" : "/storage/v1/b/substrate-sdk-gcp-poc1-test-bucket/o/conformance-tests%2Fkms%2Fupload-empty-key",
6+
"method" : "DELETE"
7+
},
8+
"response" : {
9+
"status" : 204,
10+
"headers" : {
11+
"Alt-Svc" : "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000",
12+
"Server" : "UploadServer",
13+
"Cache-Control" : "no-cache, no-store, max-age=0, must-revalidate",
14+
"X-GUploader-UploadID" : "AJRbA5W0aUjdlHaaLeivQH5wc9vQJHUmZ170AZIcVsveK_2H75VS6dTOp_1WUmVkS0v6UmjYEPlgOOx0WO2JxA",
15+
"Vary" : [ "Origin", "X-Origin" ],
16+
"Pragma" : "no-cache",
17+
"Expires" : "Mon, 01 Jan 1990 00:00:00 GMT",
18+
"Date" : "Fri, 09 Jan 2026 19:03:58 GMT",
19+
"Content-Type" : "application/json"
20+
}
21+
},
22+
"uuid" : "3d03e1e3-6e02-4d8e-aa5e-8621e48c12cf",
23+
"persistent" : true,
24+
"insertionIndex" : 876
25+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"id" : "b6ce25a4-e32f-49a2-92c5-cc2d1c942583",
3+
"name" : "storage_v1_b_substrate-sdk-gcp-poc1-test-bucket-versioned_o_conformance-tests_versionedcopyfrom_blob",
4+
"request" : {
5+
"url" : "/storage/v1/b/substrate-sdk-gcp-poc1-test-bucket-versioned/o/conformance-tests%2FversionedCopyFrom%2Fblob",
6+
"method" : "DELETE"
7+
},
8+
"response" : {
9+
"status" : 204,
10+
"headers" : {
11+
"Alt-Svc" : "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000",
12+
"Server" : "UploadServer",
13+
"Cache-Control" : "no-cache, no-store, max-age=0, must-revalidate",
14+
"X-GUploader-UploadID" : "AJRbA5V8f5ofBq1TrurQk7HXZOvA30derlkCbuOBBp32Ps_Azepsnct1SjhHKX30QVavWX3kJ4HG9FL-rSV8xw",
15+
"Vary" : [ "Origin", "X-Origin" ],
16+
"Pragma" : "no-cache",
17+
"Expires" : "Mon, 01 Jan 1990 00:00:00 GMT",
18+
"Date" : "Fri, 09 Jan 2026 19:04:42 GMT",
19+
"Content-Type" : "application/json"
20+
}
21+
},
22+
"uuid" : "b6ce25a4-e32f-49a2-92c5-cc2d1c942583",
23+
"persistent" : true,
24+
"insertionIndex" : 909
25+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"id" : "8a518ad3-a57d-4845-b5d7-f70358c77ef4",
3+
"name" : "storage_v1_b_substrate-sdk-gcp-poc1-test-bucket_o_conformance-tests_kms_ranged-read",
4+
"request" : {
5+
"url" : "/storage/v1/b/substrate-sdk-gcp-poc1-test-bucket/o/conformance-tests%2Fkms%2Franged-read",
6+
"method" : "DELETE"
7+
},
8+
"response" : {
9+
"status" : 204,
10+
"headers" : {
11+
"Alt-Svc" : "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000",
12+
"Server" : "UploadServer",
13+
"Cache-Control" : "no-cache, no-store, max-age=0, must-revalidate",
14+
"X-GUploader-UploadID" : "AJRbA5XGxixGwDKKvDYbFMAXDbop1ZFB1pW7PfUSUi3dfaoFku1uO7WVWht-z671VWXcl0rgluRUHZ2cqoe7ng",
15+
"Vary" : [ "Origin", "X-Origin" ],
16+
"Pragma" : "no-cache",
17+
"Expires" : "Mon, 01 Jan 1990 00:00:00 GMT",
18+
"Date" : "Fri, 09 Jan 2026 19:04:25 GMT",
19+
"Content-Type" : "application/json"
20+
}
21+
},
22+
"uuid" : "8a518ad3-a57d-4845-b5d7-f70358c77ef4",
23+
"persistent" : true,
24+
"insertionIndex" : 890
25+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"id" : "435ba288-36a7-4dbc-8532-5058753522ad",
3+
"name" : "storage_v1_b_substrate-sdk-gcp-poc1-test-bucket-versioned_o_conformance-tests_versionedcopyfrom_copied-from-blob-v2",
4+
"request" : {
5+
"url" : "/storage/v1/b/substrate-sdk-gcp-poc1-test-bucket-versioned/o/conformance-tests%2FversionedCopyFrom%2Fcopied-from-blob-v2",
6+
"method" : "DELETE"
7+
},
8+
"response" : {
9+
"status" : 204,
10+
"headers" : {
11+
"Alt-Svc" : "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000",
12+
"Server" : "UploadServer",
13+
"Cache-Control" : "no-cache, no-store, max-age=0, must-revalidate",
14+
"X-GUploader-UploadID" : "AJRbA5U9_ApqWN_OL8E7M92Q9gI5mQh5DmUU6Vy9W1yErEAGrDGuh1NfVN8Ml-n1OhaOfXOLFuEn7LdJ9qWBZQ",
15+
"Vary" : [ "Origin", "X-Origin" ],
16+
"Pragma" : "no-cache",
17+
"Expires" : "Mon, 01 Jan 1990 00:00:00 GMT",
18+
"Date" : "Fri, 09 Jan 2026 19:04:44 GMT",
19+
"Content-Type" : "application/json"
20+
}
21+
},
22+
"uuid" : "435ba288-36a7-4dbc-8532-5058753522ad",
23+
"persistent" : true,
24+
"insertionIndex" : 905
25+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"id" : "af2a76de-9dab-4d0c-8505-893aa1d218b7",
3+
"name" : "storage_v1_b_substrate-sdk-gcp-poc1-test-bucket-versioned_o_conformance-tests_versionedcopyfrom_copied-from-blob-v1",
4+
"request" : {
5+
"url" : "/storage/v1/b/substrate-sdk-gcp-poc1-test-bucket-versioned/o/conformance-tests%2FversionedCopyFrom%2Fcopied-from-blob-v1",
6+
"method" : "DELETE"
7+
},
8+
"response" : {
9+
"status" : 204,
10+
"headers" : {
11+
"Alt-Svc" : "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000",
12+
"Server" : "UploadServer",
13+
"Cache-Control" : "no-cache, no-store, max-age=0, must-revalidate",
14+
"X-GUploader-UploadID" : "AJRbA5V-gcsPwikL4YSS1MFJYVW0ZuusXdhYgWs2EFzBmE7tv5pSs9LIlO7gKVja4DyLDUqSKsoBbveq6saCsg",
15+
"Vary" : [ "Origin", "X-Origin" ],
16+
"Pragma" : "no-cache",
17+
"Expires" : "Mon, 01 Jan 1990 00:00:00 GMT",
18+
"Date" : "Fri, 09 Jan 2026 19:04:43 GMT",
19+
"Content-Type" : "application/json"
20+
}
21+
},
22+
"uuid" : "af2a76de-9dab-4d0c-8505-893aa1d218b7",
23+
"persistent" : true,
24+
"insertionIndex" : 907
25+
}

0 commit comments

Comments
 (0)