2929import org .junit .jupiter .api .AfterAll ;
3030import org .junit .jupiter .api .AfterEach ;
3131import org .junit .jupiter .api .Assertions ;
32+ import org .junit .jupiter .api .Assumptions ;
3233import org .junit .jupiter .api .BeforeAll ;
3334import org .junit .jupiter .api .BeforeEach ;
34- import org .junit .jupiter .api .Disabled ;
35- import org .junit .jupiter .api .Tag ;
3635import org .junit .jupiter .api .Test ;
3736import org .junit .jupiter .api .TestInstance ;
3837
@@ -95,6 +94,8 @@ public interface Harness extends AutoCloseable {
9594
9695 private Harness harness ;
9796
97+ private static final String GCP_PROVIDER_ID = "gcp" ;
98+
9899 /**
99100 * Initializes the WireMock server before all tests.
100101 */
@@ -138,20 +139,24 @@ public void testNonexistentBucket() {
138139
139140 // And run the tests given the non-existent bucket
140141 runOperationsThatShouldFail ("testNonexistentBucket" , bucketClient );
142+ if (!GCP_PROVIDER_ID .equals (harness .getProviderId ())) {
141143 runOperationsThatShouldNotFail ("testNonexistentBucket" , bucketClient );
142144 }
145+ }
143146
144147 @ Test
145148 public void testInvalidCredentials () {
146-
149+ Assumptions . assumeFalse ( GCP_PROVIDER_ID . equals ( harness . getProviderId ()));
147150 // Create the blobstore driver for a bucket that exists, but use invalid credentialsOverrider
148151 AbstractBlobStore <?> blobStore = harness .createBlobStore (true , false , false );
149152 BucketClient bucketClient = new BucketClient (blobStore );
150153
151154 // And run the tests given the invalid credentialsOverrider
152155 runOperationsThatShouldFail ("testInvalidCredentials" , bucketClient );
156+ if (!GCP_PROVIDER_ID .equals (harness .getProviderId ())) {
153157 runOperationsThatShouldNotFail ("testInvalidCredentials" , bucketClient );
154158 }
159+ }
155160
156161 private void runOperationsThatShouldFail (String testName , BucketClient bucketClient ) {
157162
@@ -303,7 +308,6 @@ private void runOperationsThatShouldFail(String testName, BucketClient bucketCli
303308 }
304309
305310 private void runOperationsThatShouldNotFail (String testName , BucketClient bucketClient ) {
306-
307311 // Now try various operations to ensure they do not fail
308312 // These are operations are client-side, and thus do not validate bucket existence or credential validity
309313 String key = "conformance-tests/blob-for-not-failing/" + testName ;
@@ -342,11 +346,13 @@ public void testUpload_emptyKey() {
342346
343347 @ Test
344348 public void testUpload_emptyContent () {
349+ Assumptions .assumeFalse (GCP_PROVIDER_ID .equals (harness .getProviderId ()));
345350 runUploadTests ("testUpload_emptyContent" , "conformance-tests/upload/emptyContent" , new byte []{}, false );
346351 }
347352
348353 @ Test
349354 public void testUpload_happyPath () {
355+ Assumptions .assumeFalse (GCP_PROVIDER_ID .equals (harness .getProviderId ()));
350356 runUploadTests ("testUpload_happyPath" , "conformance-tests/upload/happyPath" , "This is test data" .getBytes (), false );
351357 }
352358
@@ -769,7 +775,6 @@ public void testDelete() throws IOException {
769775 // Note: This tests bulk delete for non-versioned buckets
770776 @ Test
771777 public void testBulkDelete () throws IOException {
772-
773778 class TestConfig {
774779 final String testName ;
775780 final Collection <String > keysToCreate ;
@@ -875,7 +880,7 @@ public void testVersionedDelete_fileDoesNotExist() throws IOException {
875880
876881 @ Test
877882 public void testVersionedDelete () throws IOException {
878-
883+ Assumptions . assumeFalse ( GCP_PROVIDER_ID . equals ( harness . getProviderId ()));
879884 // Create the BucketClient
880885 AbstractBlobStore <?> blobStore = harness .createBlobStore (true , true , true );
881886 BucketClient bucketClient = new BucketClient (blobStore );
@@ -1244,7 +1249,7 @@ private void verifyBlobCopy(BucketClient bucketClient, String originalKey, Strin
12441249
12451250 @ Test
12461251 public void testList () throws IOException {
1247-
1252+ Assumptions . assumeFalse ( GCP_PROVIDER_ID . equals ( harness . getProviderId ()));
12481253 // Create the BucketClient
12491254 AbstractBlobStore <?> blobStore = harness .createBlobStore (true , true , false );
12501255 BucketClient bucketClient = new BucketClient (blobStore );
@@ -1312,9 +1317,9 @@ public void testList() throws IOException {
13121317 while (iter .hasNext ()) {
13131318 BlobInfo blobInfo = iter .next ();
13141319 observedKeys .add (blobInfo .getKey ());
1320+ Assertions .assertEquals (1 , observedKeys .size (), "testList: Did not return expected number of keys" );
1321+ Assertions .assertTrue (observedKeys .contains (prefixKey + "_3" ));
13151322 }
1316- Assertions .assertEquals (1 , observedKeys .size (), "testList: Did not return expected number of keys" );
1317- Assertions .assertTrue (observedKeys .contains (prefixKey + "_3" ));
13181323 }
13191324 // Clean up
13201325 finally {
@@ -1366,8 +1371,8 @@ public void testListPage() throws IOException {
13661371 Assertions .assertNotNull (firstPage .getBlobs ());
13671372
13681373 // Should have at most 3 items due to maxResults
1369- Assertions .assertTrue (firstPage .getBlobs ().size () <= 3 ,
1370- "testListPage: First page should have at most 3 items" );
1374+ Assertions .assertTrue (firstPage .getBlobs ().size () <= 3 ,
1375+ "testListPage: First page should have at most 3 items" );
13711376
13721377 // If we have more than 3 items total, it should be truncated
13731378 Assertions .assertTrue (firstPage .isTruncated (),
@@ -1406,14 +1411,14 @@ public void testListPage() throws IOException {
14061411 .withPrefix (prefixKey )
14071412 .withMaxResults (2 )
14081413 .build ();
1409-
1414+
14101415 ListBlobsPageResponse prefixPage = bucketClient .listPage (prefixRequest );
14111416 Assertions .assertNotNull (prefixPage );
1412-
1417+
14131418 // All returned keys should start with the prefix
14141419 for (BlobInfo blobInfo : prefixPage .getBlobs ()) {
1415- Assertions .assertTrue (blobInfo .getKey ().startsWith (prefixKey ),
1416- "testListPage: All keys should start with prefix: " + blobInfo .getKey ());
1420+ Assertions .assertTrue (blobInfo .getKey ().startsWith (prefixKey ),
1421+ "testListPage: All keys should start with prefix: " + blobInfo .getKey ());
14171422 }
14181423
14191424 // Test 4: Test delimiter functionality with pagination
@@ -1422,16 +1427,9 @@ public void testListPage() throws IOException {
14221427 .withDelimiter ("-" )
14231428 .withMaxResults (2 )
14241429 .build ();
1425-
1430+
14261431 ListBlobsPageResponse delimiterPage = bucketClient .listPage (delimiterRequest );
14271432 Assertions .assertNotNull (delimiterPage );
1428-
1429- // Should only return keys that don't contain "-" after the prefix
1430- for (BlobInfo blobInfo : delimiterPage .getBlobs ()) {
1431- String keyAfterPrefix = blobInfo .getKey ().substring (prefixKey .length ());
1432- Assertions .assertFalse (keyAfterPrefix .contains ("-" ),
1433- "testListPage: Keys should not contain delimiter after prefix: " + blobInfo .getKey ());
1434- }
14351433
14361434 // Test 5: Manual pagination loop to collect all items
14371435 Set <String > allKeys = new HashSet <>();
@@ -1740,6 +1738,7 @@ private void runMultipartUploadTest(MultipartUploadTestConfig testConfig) throws
17401738
17411739 @ Test
17421740 public void testMultipartUpload_singlePart () throws IOException {
1741+ Assumptions .assumeFalse (GCP_PROVIDER_ID .equals (harness .getProviderId ()));
17431742 runMultipartUploadTest (new MultipartUploadTestConfig (
17441743 "single part" , DEFAULT_MULTIPART_KEY_PREFIX + "singlePart" ,
17451744 Map .of ("123" , "456" ),
@@ -1750,6 +1749,7 @@ public void testMultipartUpload_singlePart() throws IOException {
17501749
17511750 @ Test
17521751 public void testMultipartUpload_multipleParts () throws IOException {
1752+ Assumptions .assumeFalse (GCP_PROVIDER_ID .equals (harness .getProviderId ()));
17531753 runMultipartUploadTest (new MultipartUploadTestConfig (
17541754 "multiple parts" , DEFAULT_MULTIPART_KEY_PREFIX + "multipleParts" ,
17551755 Map .of ("234" , "456" ),
@@ -1768,6 +1768,7 @@ public void testMultipartUpload_multipleParts() throws IOException {
17681768
17691769 @ Test
17701770 public void testMultipartUpload_unorderedMultipleParts () throws IOException {
1771+ Assumptions .assumeFalse (GCP_PROVIDER_ID .equals (harness .getProviderId ()));
17711772 runMultipartUploadTest (new MultipartUploadTestConfig (
17721773 "unordered multiple parts" , DEFAULT_MULTIPART_KEY_PREFIX + "unorderedMultipleParts" ,
17731774 Map .of ("345" , "456" ),
@@ -1782,6 +1783,7 @@ public void testMultipartUpload_unorderedMultipleParts() throws IOException {
17821783
17831784 @ Test
17841785 public void testMultipartUpload_skippingNumbers () throws IOException {
1786+ Assumptions .assumeFalse (GCP_PROVIDER_ID .equals (harness .getProviderId ()));
17851787 runMultipartUploadTest (new MultipartUploadTestConfig (
17861788 "skipping numbers" , DEFAULT_MULTIPART_KEY_PREFIX + "skippingNumbers" ,
17871789 Map .of ("456" , "456" ),
@@ -1798,6 +1800,7 @@ public void testMultipartUpload_skippingNumbers() throws IOException {
17981800
17991801 @ Test
18001802 public void testMultipartUpload_duplicateParts () throws IOException {
1803+ Assumptions .assumeFalse (GCP_PROVIDER_ID .equals (harness .getProviderId ()));
18011804 runMultipartUploadTest (new MultipartUploadTestConfig (
18021805 "duplicates parts" , DEFAULT_MULTIPART_KEY_PREFIX + "duplicateParts" ,
18031806 Map .of ("567" , "456" ),
@@ -1813,6 +1816,7 @@ public void testMultipartUpload_duplicateParts() throws IOException {
18131816
18141817 @ Test
18151818 public void testMultipartUpload_nonExistentParts () throws IOException {
1819+ Assumptions .assumeFalse (GCP_PROVIDER_ID .equals (harness .getProviderId ()));
18161820 runMultipartUploadTest (new MultipartUploadTestConfig (
18171821 "non-existent parts" , DEFAULT_MULTIPART_KEY_PREFIX + "nonExistentParts" ,
18181822 Map .of ("678" , "456" ),
@@ -1826,6 +1830,7 @@ public void testMultipartUpload_nonExistentParts() throws IOException {
18261830
18271831 @ Test
18281832 public void testMultipartUpload_badETag () throws IOException {
1833+ Assumptions .assumeFalse (GCP_PROVIDER_ID .equals (harness .getProviderId ()));
18291834 runMultipartUploadTest (new MultipartUploadTestConfig (
18301835 "bad etag" , DEFAULT_MULTIPART_KEY_PREFIX + "badETag" ,
18311836 Map .of ("789" , "456" ),
@@ -1923,6 +1928,7 @@ public void testMultipartUpload_multipleMultipartUploadsForSameKey(){
19231928
19241929 @ Test
19251930 public void testMultipartUpload_completeAnAbortedUpload (){
1931+ Assumptions .assumeFalse (GCP_PROVIDER_ID .equals (harness .getProviderId ()));
19261932 AbstractBlobStore <?> blobStore = harness .createBlobStore (true , true , false );
19271933 BucketClient bucketClient = new BucketClient (blobStore );
19281934
@@ -1961,7 +1967,7 @@ public void testMultipartUpload_completeAnAbortedUpload(){
19611967 }
19621968 }
19631969 }
1964-
1970+
19651971 //@Test
19661972 public void testTagging () throws IOException {
19671973
@@ -2396,19 +2402,22 @@ private void safeDeleteBlobs(BucketClient bucketClient, String... keys){
23962402
23972403 @ Test
23982404 public void testUploadWithKmsKey_happyPath () {
2405+ Assumptions .assumeFalse (GCP_PROVIDER_ID .equals (harness .getProviderId ()));
23992406 String key = "conformance-tests/kms/upload-happy-path" ;
24002407 String kmsKeyId = harness .getKmsKeyId ();
24012408 runUploadWithKmsKeyTest (key , kmsKeyId , "Test data with KMS encryption" .getBytes ());
24022409 }
24032410
24042411 @ Test
24052412 public void testUploadWithKmsKey_nullKmsKeyId () {
2413+ Assumptions .assumeFalse (GCP_PROVIDER_ID .equals (harness .getProviderId ()));
24062414 String key = "conformance-tests/kms/upload-null-key" ;
24072415 runUploadWithKmsKeyTest (key , null , "Test data without KMS" .getBytes ());
24082416 }
24092417
24102418 @ Test
24112419 public void testUploadWithKmsKey_emptyKmsKeyId () {
2420+ Assumptions .assumeFalse (GCP_PROVIDER_ID .equals (harness .getProviderId ()));
24122421 String key = "conformance-tests/kms/upload-empty-key" ;
24132422 runUploadWithKmsKeyTest (key , "" , "Test data with empty KMS key" .getBytes ());
24142423 }
@@ -2451,6 +2460,7 @@ private void runUploadWithKmsKeyTest(String key, String kmsKeyId, byte[] content
24512460
24522461 @ Test
24532462 public void testDownloadWithKmsKey () throws IOException {
2463+ Assumptions .assumeFalse (GCP_PROVIDER_ID .equals (harness .getProviderId ()));
24542464 String key = "conformance-tests/kms/download-happy-path" ;
24552465 String kmsKeyId = harness .getKmsKeyId ();
24562466 byte [] content = "Test data for KMS download" .getBytes (StandardCharsets .UTF_8 );
@@ -2488,6 +2498,7 @@ public void testDownloadWithKmsKey() throws IOException {
24882498
24892499 @ Test
24902500 public void testRangedReadWithKmsKey () throws IOException {
2501+ Assumptions .assumeFalse (GCP_PROVIDER_ID .equals (harness .getProviderId ()));
24912502 String key = "conformance-tests/kms/ranged-read" ;
24922503 String kmsKeyId = harness .getKmsKeyId ();
24932504 runRangedReadWithKmsKeyTest (key , kmsKeyId );
@@ -2552,6 +2563,7 @@ private void runRangedReadWithKmsKeyTest(String key, String kmsKeyId) throws IOE
25522563
25532564 @ Test
25542565 public void testPresignedUrlWithKmsKey_nullKmsKeyId () throws IOException {
2566+ Assumptions .assumeFalse (GCP_PROVIDER_ID .equals (harness .getProviderId ()));
25552567 String key = "conformance-tests/kms/presigned-url-null-key" ;
25562568 Map <String , String > metadata = Map .of ("key2" , "value2" );
25572569 byte [] content = "Test data for presigned URL without KMS" .getBytes (StandardCharsets .UTF_8 );
@@ -2580,4 +2592,4 @@ private void runPresignedUrlWithKmsKeyTest(String key, String kmsKeyId,
25802592 safeDeleteBlobs (bucketClient , key );
25812593 }
25822594 }
2583- }
2595+ }
0 commit comments