This is an automated email from the ASF dual-hosted git repository.

jshao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git


The following commit(s) were added to refs/heads/main by this push:
     new 486c042cb2 [#5989] The credential type of ADLSTokenCredentialProvider 
is not equal to the credential type of ADLSTokenCredential  (#5990)
486c042cb2 is described below

commit 486c042cb23182c761881cd7f5b6826d038001d0
Author: FANNG <[email protected]>
AuthorDate: Sat Dec 28 17:00:25 2024 +0800

    [#5989] The credential type of ADLSTokenCredentialProvider is not equal to 
the credential type of ADLSTokenCredential  (#5990)
    
    ### What changes were proposed in this pull request?
    
    ADLSTokenCredentialProvider use the credential type from
    ADLSTokenCredential
    
    ### Why are the changes needed?
    
    
    Fix: #5989
    
    ### Does this PR introduce _any_ user-facing change?
    no
    
    ### How was this patch tested?
    add test
---
 .../gravitino/credential/ADLSTokenCredential.java  |  6 ++--
 bundles/aliyun/build.gradle.kts                    |  6 ++++
 .../oss/credential/TestCredentialProvider.java     | 40 ++++++++++++++++++++++
 bundles/aws/build.gradle.kts                       |  6 ++++
 .../s3/credential/TestCredentialProvider.java      | 39 +++++++++++++++++++++
 bundles/azure/build.gradle.kts                     |  6 ++++
 .../abs/credential/ADLSTokenProvider.java          |  3 +-
 .../abs/credential/AzureAccountKeyProvider.java    |  3 +-
 .../abs/credential/TestCredentialProvider.java     | 40 ++++++++++++++++++++++
 bundles/gcp/build.gradle.kts                       |  6 ++++
 .../gravitino/gcs/credential/GCSTokenProvider.java |  3 +-
 .../gcs/credential/TestCredentialProvider.java     | 34 ++++++++++++++++++
 .../gravitino/credential/CredentialConstants.java  |  9 -----
 .../api/credential/adls_token_credential.py        |  4 +--
 .../gravitino/utils/credential_factory.py          |  2 +-
 .../tests/unittests/test_credential_factory.py     |  2 +-
 .../credential/TestCredentialFactory.java          |  6 ++--
 .../integration/test/IcebergRESTADLSTokenIT.java   |  3 +-
 .../test/IcebergRESTAzureAccountKeyIT.java         |  3 +-
 .../iceberg/integration/test/IcebergRESTGCSIT.java |  3 +-
 .../iceberg/integration/test/IcebergRESTOSSIT.java |  3 +-
 .../iceberg/integration/test/IcebergRESTS3IT.java  |  3 +-
 22 files changed, 199 insertions(+), 31 deletions(-)

diff --git 
a/api/src/main/java/org/apache/gravitino/credential/ADLSTokenCredential.java 
b/api/src/main/java/org/apache/gravitino/credential/ADLSTokenCredential.java
index 25c83c2f7c..249b0ac0b0 100644
--- a/api/src/main/java/org/apache/gravitino/credential/ADLSTokenCredential.java
+++ b/api/src/main/java/org/apache/gravitino/credential/ADLSTokenCredential.java
@@ -27,8 +27,8 @@ import org.apache.commons.lang3.StringUtils;
 /** ADLS SAS token credential. */
 public class ADLSTokenCredential implements Credential {
 
-  /** ADLS SAS token credential type. */
-  public static final String ADLS_SAS_TOKEN_CREDENTIAL_TYPE = "adls-sas-token";
+  /** ADLS token credential type. */
+  public static final String ADLS_TOKEN_CREDENTIAL_TYPE = "adls-token";
   /** ADLS base domain */
   public static final String ADLS_DOMAIN = "dfs.core.windows.net";
   /** ADLS storage account name */
@@ -62,7 +62,7 @@ public class ADLSTokenCredential implements Credential {
 
   @Override
   public String credentialType() {
-    return ADLS_SAS_TOKEN_CREDENTIAL_TYPE;
+    return ADLS_TOKEN_CREDENTIAL_TYPE;
   }
 
   @Override
diff --git a/bundles/aliyun/build.gradle.kts b/bundles/aliyun/build.gradle.kts
index f4d38d40b9..9dfab9d679 100644
--- a/bundles/aliyun/build.gradle.kts
+++ b/bundles/aliyun/build.gradle.kts
@@ -60,6 +60,12 @@ dependencies {
   // Aliyun oss SDK depends on this package, and JDK >= 9 requires manual add
   // 
https://www.alibabacloud.com/help/en/oss/developer-reference/java-installation?spm=a2c63.p38356.0.i1
   implementation(libs.sun.activation)
+
+  testImplementation(project(":api"))
+  testImplementation(project(":core"))
+  testImplementation(libs.junit.jupiter.api)
+  testImplementation(libs.junit.jupiter.params)
+  testRuntimeOnly(libs.junit.jupiter.engine)
 }
 
 tasks.withType(ShadowJar::class.java) {
diff --git 
a/bundles/aliyun/src/test/java/org/apache/gravitino/oss/credential/TestCredentialProvider.java
 
b/bundles/aliyun/src/test/java/org/apache/gravitino/oss/credential/TestCredentialProvider.java
new file mode 100644
index 0000000000..0e8cd2fb74
--- /dev/null
+++ 
b/bundles/aliyun/src/test/java/org/apache/gravitino/oss/credential/TestCredentialProvider.java
@@ -0,0 +1,40 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.gravitino.oss.credential;
+
+import org.apache.gravitino.credential.OSSSecretKeyCredential;
+import org.apache.gravitino.credential.OSSTokenCredential;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+public class TestCredentialProvider {
+
+  @Test
+  void testCredentialProviderType() {
+    OSSTokenProvider ossTokenProvider = new OSSTokenProvider();
+    Assertions.assertEquals(
+        OSSTokenCredential.OSS_TOKEN_CREDENTIAL_TYPE, 
ossTokenProvider.credentialType());
+
+    OSSSecretKeyProvider ossSecretKeyProvider = new OSSSecretKeyProvider();
+    Assertions.assertEquals(
+        OSSSecretKeyCredential.OSS_SECRET_KEY_CREDENTIAL_TYPE,
+        ossSecretKeyProvider.credentialType());
+  }
+}
diff --git a/bundles/aws/build.gradle.kts b/bundles/aws/build.gradle.kts
index 45fda5485d..da06c4d2cc 100644
--- a/bundles/aws/build.gradle.kts
+++ b/bundles/aws/build.gradle.kts
@@ -46,6 +46,12 @@ dependencies {
   implementation(libs.commons.lang3)
   implementation(libs.hadoop3.aws)
   implementation(libs.guava)
+
+  testImplementation(project(":api"))
+  testImplementation(project(":core"))
+  testImplementation(libs.junit.jupiter.api)
+  testImplementation(libs.junit.jupiter.params)
+  testRuntimeOnly(libs.junit.jupiter.engine)
 }
 
 tasks.withType(ShadowJar::class.java) {
diff --git 
a/bundles/aws/src/test/java/org/apache/gravitino/s3/credential/TestCredentialProvider.java
 
b/bundles/aws/src/test/java/org/apache/gravitino/s3/credential/TestCredentialProvider.java
new file mode 100644
index 0000000000..c0aaeaefcf
--- /dev/null
+++ 
b/bundles/aws/src/test/java/org/apache/gravitino/s3/credential/TestCredentialProvider.java
@@ -0,0 +1,39 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.gravitino.s3.credential;
+
+import org.apache.gravitino.credential.S3SecretKeyCredential;
+import org.apache.gravitino.credential.S3TokenCredential;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+public class TestCredentialProvider {
+
+  @Test
+  void testCredentialProviderType() {
+    S3TokenProvider s3TokenProvider = new S3TokenProvider();
+    Assertions.assertEquals(
+        S3TokenCredential.S3_TOKEN_CREDENTIAL_TYPE, 
s3TokenProvider.credentialType());
+
+    S3SecretKeyProvider s3SecretKeyProvider = new S3SecretKeyProvider();
+    Assertions.assertEquals(
+        S3SecretKeyCredential.S3_SECRET_KEY_CREDENTIAL_TYPE, 
s3SecretKeyProvider.credentialType());
+  }
+}
diff --git a/bundles/azure/build.gradle.kts b/bundles/azure/build.gradle.kts
index 59d8cf5f80..8dbd6ed489 100644
--- a/bundles/azure/build.gradle.kts
+++ b/bundles/azure/build.gradle.kts
@@ -47,6 +47,12 @@ dependencies {
   // runtime used
   implementation(libs.commons.logging)
   implementation(libs.guava)
+
+  testImplementation(project(":api"))
+  testImplementation(project(":core"))
+  testImplementation(libs.junit.jupiter.api)
+  testImplementation(libs.junit.jupiter.params)
+  testRuntimeOnly(libs.junit.jupiter.engine)
 }
 
 tasks.withType(ShadowJar::class.java) {
diff --git 
a/bundles/azure/src/main/java/org/apache/gravitino/abs/credential/ADLSTokenProvider.java
 
b/bundles/azure/src/main/java/org/apache/gravitino/abs/credential/ADLSTokenProvider.java
index c2b684acbd..3ec9d56c28 100644
--- 
a/bundles/azure/src/main/java/org/apache/gravitino/abs/credential/ADLSTokenProvider.java
+++ 
b/bundles/azure/src/main/java/org/apache/gravitino/abs/credential/ADLSTokenProvider.java
@@ -34,7 +34,6 @@ import java.util.Map;
 import java.util.Set;
 import org.apache.gravitino.credential.ADLSTokenCredential;
 import org.apache.gravitino.credential.Credential;
-import org.apache.gravitino.credential.CredentialConstants;
 import org.apache.gravitino.credential.CredentialContext;
 import org.apache.gravitino.credential.CredentialProvider;
 import org.apache.gravitino.credential.PathBasedCredentialContext;
@@ -66,7 +65,7 @@ public class ADLSTokenProvider implements CredentialProvider {
 
   @Override
   public String credentialType() {
-    return CredentialConstants.ADLS_TOKEN_CREDENTIAL_PROVIDER_TYPE;
+    return ADLSTokenCredential.ADLS_TOKEN_CREDENTIAL_TYPE;
   }
 
   @Override
diff --git 
a/bundles/azure/src/main/java/org/apache/gravitino/abs/credential/AzureAccountKeyProvider.java
 
b/bundles/azure/src/main/java/org/apache/gravitino/abs/credential/AzureAccountKeyProvider.java
index 726c4f2d99..c17a7cbc10 100644
--- 
a/bundles/azure/src/main/java/org/apache/gravitino/abs/credential/AzureAccountKeyProvider.java
+++ 
b/bundles/azure/src/main/java/org/apache/gravitino/abs/credential/AzureAccountKeyProvider.java
@@ -22,7 +22,6 @@ package org.apache.gravitino.abs.credential;
 import java.util.Map;
 import org.apache.gravitino.credential.AzureAccountKeyCredential;
 import org.apache.gravitino.credential.Credential;
-import org.apache.gravitino.credential.CredentialConstants;
 import org.apache.gravitino.credential.CredentialContext;
 import org.apache.gravitino.credential.CredentialProvider;
 import org.apache.gravitino.credential.config.AzureCredentialConfig;
@@ -44,7 +43,7 @@ public class AzureAccountKeyProvider implements 
CredentialProvider {
 
   @Override
   public String credentialType() {
-    return CredentialConstants.AZURE_ACCOUNT_KEY_CREDENTIAL_PROVIDER_TYPE;
+    return AzureAccountKeyCredential.AZURE_ACCOUNT_KEY_CREDENTIAL_TYPE;
   }
 
   @Override
diff --git 
a/bundles/azure/src/test/java/org/apache/gravitino/abs/credential/TestCredentialProvider.java
 
b/bundles/azure/src/test/java/org/apache/gravitino/abs/credential/TestCredentialProvider.java
new file mode 100644
index 0000000000..2a48d521a2
--- /dev/null
+++ 
b/bundles/azure/src/test/java/org/apache/gravitino/abs/credential/TestCredentialProvider.java
@@ -0,0 +1,40 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.gravitino.abs.credential;
+
+import org.apache.gravitino.credential.ADLSTokenCredential;
+import org.apache.gravitino.credential.AzureAccountKeyCredential;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+public class TestCredentialProvider {
+
+  @Test
+  void testCredentialProviderType() {
+    ADLSTokenProvider adlsTokenProvider = new ADLSTokenProvider();
+    Assertions.assertEquals(
+        ADLSTokenCredential.ADLS_TOKEN_CREDENTIAL_TYPE, 
adlsTokenProvider.credentialType());
+
+    AzureAccountKeyProvider azureAccountKeyProvider = new 
AzureAccountKeyProvider();
+    Assertions.assertEquals(
+        AzureAccountKeyCredential.AZURE_ACCOUNT_KEY_CREDENTIAL_TYPE,
+        azureAccountKeyProvider.credentialType());
+  }
+}
diff --git a/bundles/gcp/build.gradle.kts b/bundles/gcp/build.gradle.kts
index 6f21dc3d5a..95907f8a3b 100644
--- a/bundles/gcp/build.gradle.kts
+++ b/bundles/gcp/build.gradle.kts
@@ -44,6 +44,12 @@ dependencies {
   implementation(libs.commons.logging)
   implementation(libs.google.auth.credentials)
   implementation(libs.google.auth.http)
+
+  testImplementation(project(":api"))
+  testImplementation(project(":core"))
+  testImplementation(libs.junit.jupiter.api)
+  testImplementation(libs.junit.jupiter.params)
+  testRuntimeOnly(libs.junit.jupiter.engine)
 }
 
 tasks.withType(ShadowJar::class.java) {
diff --git 
a/bundles/gcp/src/main/java/org/apache/gravitino/gcs/credential/GCSTokenProvider.java
 
b/bundles/gcp/src/main/java/org/apache/gravitino/gcs/credential/GCSTokenProvider.java
index 94234b2d98..3f7d5bcfaa 100644
--- 
a/bundles/gcp/src/main/java/org/apache/gravitino/gcs/credential/GCSTokenProvider.java
+++ 
b/bundles/gcp/src/main/java/org/apache/gravitino/gcs/credential/GCSTokenProvider.java
@@ -38,7 +38,6 @@ import java.util.Set;
 import java.util.stream.Stream;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.gravitino.credential.Credential;
-import org.apache.gravitino.credential.CredentialConstants;
 import org.apache.gravitino.credential.CredentialContext;
 import org.apache.gravitino.credential.CredentialProvider;
 import org.apache.gravitino.credential.GCSTokenCredential;
@@ -68,7 +67,7 @@ public class GCSTokenProvider implements CredentialProvider {
 
   @Override
   public String credentialType() {
-    return CredentialConstants.GCS_TOKEN_CREDENTIAL_PROVIDER_TYPE;
+    return GCSTokenCredential.GCS_TOKEN_CREDENTIAL_TYPE;
   }
 
   @Override
diff --git 
a/bundles/gcp/src/test/java/org/apache/gravitino/gcs/credential/TestCredentialProvider.java
 
b/bundles/gcp/src/test/java/org/apache/gravitino/gcs/credential/TestCredentialProvider.java
new file mode 100644
index 0000000000..162e02c987
--- /dev/null
+++ 
b/bundles/gcp/src/test/java/org/apache/gravitino/gcs/credential/TestCredentialProvider.java
@@ -0,0 +1,34 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.gravitino.gcs.credential;
+
+import org.apache.gravitino.credential.GCSTokenCredential;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+public class TestCredentialProvider {
+
+  @Test
+  void testCredentialProviderType() {
+    GCSTokenProvider gcsTokenProvider = new GCSTokenProvider();
+    Assertions.assertEquals(
+        GCSTokenCredential.GCS_TOKEN_CREDENTIAL_TYPE, 
gcsTokenProvider.credentialType());
+  }
+}
diff --git 
a/catalogs/catalog-common/src/main/java/org/apache/gravitino/credential/CredentialConstants.java
 
b/catalogs/catalog-common/src/main/java/org/apache/gravitino/credential/CredentialConstants.java
index c766a86c14..7d552deb6b 100644
--- 
a/catalogs/catalog-common/src/main/java/org/apache/gravitino/credential/CredentialConstants.java
+++ 
b/catalogs/catalog-common/src/main/java/org/apache/gravitino/credential/CredentialConstants.java
@@ -24,18 +24,9 @@ public class CredentialConstants {
   public static final String CREDENTIAL_PROVIDERS = "credential-providers";
   public static final String CREDENTIAL_CACHE_EXPIRE_RATIO = 
"credential-cache-expire-ratio";
   public static final String CREDENTIAL_CACHE_MAX_SIZE = 
"credential-cache-max-size";
-  public static final String S3_TOKEN_CREDENTIAL_PROVIDER = "s3-token";
   public static final String S3_TOKEN_EXPIRE_IN_SECS = 
"s3-token-expire-in-secs";
-
-  public static final String GCS_TOKEN_CREDENTIAL_PROVIDER_TYPE = "gcs-token";
-
-  public static final String OSS_TOKEN_CREDENTIAL_PROVIDER = "oss-token";
   public static final String OSS_TOKEN_EXPIRE_IN_SECS = 
"oss-token-expire-in-secs";
-
-  public static final String ADLS_TOKEN_CREDENTIAL_PROVIDER_TYPE = 
"adls-token";
   public static final String ADLS_TOKEN_EXPIRE_IN_SECS = 
"adls-token-expire-in-secs";
 
-  public static final String AZURE_ACCOUNT_KEY_CREDENTIAL_PROVIDER_TYPE = 
"azure-account-key";
-
   private CredentialConstants() {}
 }
diff --git 
a/clients/client-python/gravitino/api/credential/adls_token_credential.py 
b/clients/client-python/gravitino/api/credential/adls_token_credential.py
index 40ad0eebbd..641a69bae9 100644
--- a/clients/client-python/gravitino/api/credential/adls_token_credential.py
+++ b/clients/client-python/gravitino/api/credential/adls_token_credential.py
@@ -25,7 +25,7 @@ from gravitino.utils.precondition import Precondition
 class ADLSTokenCredential(Credential, ABC):
     """Represents ADLS token credential."""
 
-    ADLS_SAS_TOKEN_CREDENTIAL_TYPE: str = "adls-sas-token"
+    ADLS_TOKEN_CREDENTIAL_TYPE: str = "adls-token"
     ADLS_DOMAIN: str = "dfs.core.windows.net"
     _STORAGE_ACCOUNT_NAME: str = "azure-storage-account-name"
     _SAS_TOKEN: str = "adls-sas-token"
@@ -51,7 +51,7 @@ class ADLSTokenCredential(Credential, ABC):
         Returns:
              the type of the credential.
         """
-        return self.ADLS_SAS_TOKEN_CREDENTIAL_TYPE
+        return self.ADLS_TOKEN_CREDENTIAL_TYPE
 
     def expire_time_in_ms(self) -> int:
         """Returns the expiration time of the credential in milliseconds since
diff --git a/clients/client-python/gravitino/utils/credential_factory.py 
b/clients/client-python/gravitino/utils/credential_factory.py
index 32d7465b80..5d566e509b 100644
--- a/clients/client-python/gravitino/utils/credential_factory.py
+++ b/clients/client-python/gravitino/utils/credential_factory.py
@@ -46,7 +46,7 @@ class CredentialFactory:
             credential = OSSTokenCredential(credential_info, expire_time_in_ms)
         elif credential_type == 
OSSSecretKeyCredential.OSS_SECRET_KEY_CREDENTIAL_TYPE:
             credential = OSSSecretKeyCredential(credential_info, 
expire_time_in_ms)
-        elif credential_type == 
ADLSTokenCredential.ADLS_SAS_TOKEN_CREDENTIAL_TYPE:
+        elif credential_type == ADLSTokenCredential.ADLS_TOKEN_CREDENTIAL_TYPE:
             credential = ADLSTokenCredential(credential_info, 
expire_time_in_ms)
         elif (
             credential_type
diff --git a/clients/client-python/tests/unittests/test_credential_factory.py 
b/clients/client-python/tests/unittests/test_credential_factory.py
index 4c4a91495a..fddbbc098b 100644
--- a/clients/client-python/tests/unittests/test_credential_factory.py
+++ b/clients/client-python/tests/unittests/test_credential_factory.py
@@ -156,7 +156,7 @@ class TestCredentialFactory(unittest.TestCase):
             adls_credential.credential_type(), credential_info, expire_time
         )
         self.assertEqual(
-            ADLSTokenCredential.ADLS_SAS_TOKEN_CREDENTIAL_TYPE,
+            ADLSTokenCredential.ADLS_TOKEN_CREDENTIAL_TYPE,
             check_credential.credential_type(),
         )
 
diff --git 
a/common/src/test/java/org/apache/gravitino/credential/TestCredentialFactory.java
 
b/common/src/test/java/org/apache/gravitino/credential/TestCredentialFactory.java
index 6291b8857d..7bb766a462 100644
--- 
a/common/src/test/java/org/apache/gravitino/credential/TestCredentialFactory.java
+++ 
b/common/src/test/java/org/apache/gravitino/credential/TestCredentialFactory.java
@@ -153,11 +153,9 @@ public class TestCredentialFactory {
     long expireTime = 100;
     Credential credential =
         CredentialFactory.create(
-            ADLSTokenCredential.ADLS_SAS_TOKEN_CREDENTIAL_TYPE,
-            adlsTokenCredentialInfo,
-            expireTime);
+            ADLSTokenCredential.ADLS_TOKEN_CREDENTIAL_TYPE, 
adlsTokenCredentialInfo, expireTime);
     Assertions.assertEquals(
-        ADLSTokenCredential.ADLS_SAS_TOKEN_CREDENTIAL_TYPE, 
credential.credentialType());
+        ADLSTokenCredential.ADLS_TOKEN_CREDENTIAL_TYPE, 
credential.credentialType());
     Assertions.assertInstanceOf(ADLSTokenCredential.class, credential);
 
     ADLSTokenCredential adlsTokenCredential = (ADLSTokenCredential) credential;
diff --git 
a/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRESTADLSTokenIT.java
 
b/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRESTADLSTokenIT.java
index b16d504e1e..b663251e0e 100644
--- 
a/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRESTADLSTokenIT.java
+++ 
b/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRESTADLSTokenIT.java
@@ -24,6 +24,7 @@ import java.util.HashMap;
 import java.util.Map;
 import org.apache.gravitino.abs.credential.ADLSLocationUtils;
 import org.apache.gravitino.catalog.lakehouse.iceberg.IcebergConstants;
+import org.apache.gravitino.credential.ADLSTokenCredential;
 import org.apache.gravitino.credential.CredentialConstants;
 import org.apache.gravitino.iceberg.common.IcebergConfig;
 import org.apache.gravitino.integration.test.util.BaseIT;
@@ -92,7 +93,7 @@ public class IcebergRESTADLSTokenIT extends 
IcebergRESTJdbcCatalogIT {
 
     configMap.put(
         IcebergConfig.ICEBERG_CONFIG_PREFIX + 
CredentialConstants.CREDENTIAL_PROVIDER_TYPE,
-        CredentialConstants.ADLS_TOKEN_CREDENTIAL_PROVIDER_TYPE);
+        ADLSTokenCredential.ADLS_TOKEN_CREDENTIAL_TYPE);
     configMap.put(
         IcebergConfig.ICEBERG_CONFIG_PREFIX + 
AzureProperties.GRAVITINO_AZURE_STORAGE_ACCOUNT_NAME,
         storageAccountName);
diff --git 
a/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRESTAzureAccountKeyIT.java
 
b/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRESTAzureAccountKeyIT.java
index 42709162aa..695b72ed4b 100644
--- 
a/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRESTAzureAccountKeyIT.java
+++ 
b/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRESTAzureAccountKeyIT.java
@@ -23,6 +23,7 @@ import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
 import org.apache.gravitino.catalog.lakehouse.iceberg.IcebergConstants;
+import org.apache.gravitino.credential.AzureAccountKeyCredential;
 import org.apache.gravitino.credential.CredentialConstants;
 import org.apache.gravitino.iceberg.common.IcebergConfig;
 import org.apache.gravitino.integration.test.util.BaseIT;
@@ -82,7 +83,7 @@ public class IcebergRESTAzureAccountKeyIT extends 
IcebergRESTJdbcCatalogIT {
 
     configMap.put(
         IcebergConfig.ICEBERG_CONFIG_PREFIX + 
CredentialConstants.CREDENTIAL_PROVIDER_TYPE,
-        CredentialConstants.AZURE_ACCOUNT_KEY_CREDENTIAL_PROVIDER_TYPE);
+        AzureAccountKeyCredential.AZURE_ACCOUNT_KEY_CREDENTIAL_TYPE);
     configMap.put(
         IcebergConfig.ICEBERG_CONFIG_PREFIX + 
AzureProperties.GRAVITINO_AZURE_STORAGE_ACCOUNT_NAME,
         storageAccountName);
diff --git 
a/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRESTGCSIT.java
 
b/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRESTGCSIT.java
index 8f7821cb48..11ee27bf44 100644
--- 
a/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRESTGCSIT.java
+++ 
b/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRESTGCSIT.java
@@ -24,6 +24,7 @@ import java.util.HashMap;
 import java.util.Map;
 import org.apache.gravitino.catalog.lakehouse.iceberg.IcebergConstants;
 import org.apache.gravitino.credential.CredentialConstants;
+import org.apache.gravitino.credential.GCSTokenCredential;
 import org.apache.gravitino.credential.config.GCSCredentialConfig;
 import org.apache.gravitino.iceberg.common.IcebergConfig;
 import org.apache.gravitino.integration.test.util.BaseIT;
@@ -73,7 +74,7 @@ public class IcebergRESTGCSIT extends 
IcebergRESTJdbcCatalogIT {
 
     configMap.put(
         IcebergConfig.ICEBERG_CONFIG_PREFIX + 
CredentialConstants.CREDENTIAL_PROVIDER_TYPE,
-        CredentialConstants.GCS_TOKEN_CREDENTIAL_PROVIDER_TYPE);
+        GCSTokenCredential.GCS_TOKEN_CREDENTIAL_TYPE);
     configMap.put(
         IcebergConfig.ICEBERG_CONFIG_PREFIX
             + GCSCredentialConfig.GRAVITINO_GCS_CREDENTIAL_FILE_PATH,
diff --git 
a/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRESTOSSIT.java
 
b/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRESTOSSIT.java
index f3aaafabb8..af70253d84 100644
--- 
a/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRESTOSSIT.java
+++ 
b/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRESTOSSIT.java
@@ -24,6 +24,7 @@ import java.util.HashMap;
 import java.util.Map;
 import org.apache.gravitino.catalog.lakehouse.iceberg.IcebergConstants;
 import org.apache.gravitino.credential.CredentialConstants;
+import org.apache.gravitino.credential.OSSTokenCredential;
 import org.apache.gravitino.iceberg.common.IcebergConfig;
 import org.apache.gravitino.integration.test.util.BaseIT;
 import org.apache.gravitino.integration.test.util.DownloaderUtils;
@@ -86,7 +87,7 @@ public class IcebergRESTOSSIT extends 
IcebergRESTJdbcCatalogIT {
 
     configMap.put(
         IcebergConfig.ICEBERG_CONFIG_PREFIX + 
CredentialConstants.CREDENTIAL_PROVIDER_TYPE,
-        CredentialConstants.OSS_TOKEN_CREDENTIAL_PROVIDER);
+        OSSTokenCredential.OSS_TOKEN_CREDENTIAL_TYPE);
     configMap.put(IcebergConfig.ICEBERG_CONFIG_PREFIX + 
OSSProperties.GRAVITINO_OSS_REGION, region);
     configMap.put(
         IcebergConfig.ICEBERG_CONFIG_PREFIX + 
OSSProperties.GRAVITINO_OSS_ENDPOINT, endpoint);
diff --git 
a/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRESTS3IT.java
 
b/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRESTS3IT.java
index d31278051a..7e16273245 100644
--- 
a/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRESTS3IT.java
+++ 
b/iceberg/iceberg-rest-server/src/test/java/org/apache/gravitino/iceberg/integration/test/IcebergRESTS3IT.java
@@ -26,6 +26,7 @@ import java.util.List;
 import java.util.Map;
 import org.apache.gravitino.catalog.lakehouse.iceberg.IcebergConstants;
 import org.apache.gravitino.credential.CredentialConstants;
+import org.apache.gravitino.credential.S3TokenCredential;
 import org.apache.gravitino.iceberg.common.IcebergConfig;
 import org.apache.gravitino.integration.test.util.BaseIT;
 import org.apache.gravitino.integration.test.util.DownloaderUtils;
@@ -87,7 +88,7 @@ public class IcebergRESTS3IT extends IcebergRESTJdbcCatalogIT 
{
 
     configMap.put(
         IcebergConfig.ICEBERG_CONFIG_PREFIX + 
CredentialConstants.CREDENTIAL_PROVIDER_TYPE,
-        CredentialConstants.S3_TOKEN_CREDENTIAL_PROVIDER);
+        S3TokenCredential.S3_TOKEN_CREDENTIAL_TYPE);
     configMap.put(IcebergConfig.ICEBERG_CONFIG_PREFIX + 
S3Properties.GRAVITINO_S3_REGION, region);
     configMap.put(
         IcebergConfig.ICEBERG_CONFIG_PREFIX + 
S3Properties.GRAVITINO_S3_ACCESS_KEY_ID, accessKey);

Reply via email to