You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2023/01/18 03:51:00 UTC

[iotdb] 01/01: Fix files with unapporved license error after running OpenIdAuthorizerTest

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

haonan pushed a commit to branch Fix_openid_ut
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 1198a2cef0fad4e22497b3ee81c8dc02521fbc36
Author: HTHou <hh...@outlook.com>
AuthorDate: Wed Jan 18 11:50:11 2023 +0800

    Fix files with unapporved license error after running OpenIdAuthorizerTest
---
 .../iotdb/db/auth/authorizer/OpenIdAuthorizerTest.java   | 16 +++++++++++++++-
 server/src/test/resources/iotdb-datanode.properties      |  2 +-
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/server/src/test/java/org/apache/iotdb/db/auth/authorizer/OpenIdAuthorizerTest.java b/server/src/test/java/org/apache/iotdb/db/auth/authorizer/OpenIdAuthorizerTest.java
index c6b1e6f28f..bd0c2d399e 100644
--- a/server/src/test/java/org/apache/iotdb/db/auth/authorizer/OpenIdAuthorizerTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/auth/authorizer/OpenIdAuthorizerTest.java
@@ -22,9 +22,12 @@ import org.apache.iotdb.commons.auth.AuthException;
 import org.apache.iotdb.commons.auth.authorizer.OpenIdAuthorizer;
 import org.apache.iotdb.commons.conf.CommonConfig;
 import org.apache.iotdb.commons.conf.CommonDescriptor;
+import org.apache.iotdb.db.utils.EnvironmentUtils;
 
 import com.nimbusds.oauth2.sdk.ParseException;
 import com.nimbusds.oauth2.sdk.util.JSONObjectUtils;
+import org.junit.After;
+import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
 
@@ -38,7 +41,18 @@ public class OpenIdAuthorizerTest {
 
   private static final String OPEN_ID_PUBLIC_JWK =
       "{\"kty\":\"RSA\",\"x5t#S256\":\"TZFbbj6HsRU28HYvrcVnDs03KreV3DE24-Cxb9EPdS4\",\"e\":\"AQAB\",\"use\":\"sig\",\"x5t\":\"l_N2UlC_a624iu5eYFypnB1Wr20\",\"kid\":\"q1-Wm0ozQ5O0mQH8-SJap2ZcN4MmucWwnQWKYxZJ4ow\",\"x5c\":[\"MIICmTCCAYECBgFyRdXW2DANBgkqhkiG9w0BAQsFADAQMQ4wDAYDVQQDDAVJb1REQjAeFw0yMDA1MjQwODM3MjJaFw0zMDA1MjQwODM5MDJaMBAxDjAMBgNVBAMMBUlvVERCMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAozDCZTVc9946VvhZ6E\\/OP8Yx6tJe0i9GR2Q9jR9S3jQoo0haT\\/P1b\\/zvQK52qA1xj6tBVg64xl3+LUxtCvh3HfA [...]
-  private static final CommonConfig config = CommonDescriptor.getInstance().getConfig();
+  private static CommonConfig config;
+
+  @Before
+  public void setUp() throws Exception {
+    EnvironmentUtils.envSetUp();
+    config = CommonDescriptor.getInstance().getConfig();
+  }
+
+  @After
+  public void tearDown() throws Exception {
+    EnvironmentUtils.cleanEnv();
+  }
 
   @Test
   public void loginWithJWT() throws AuthException, ParseException {
diff --git a/server/src/test/resources/iotdb-datanode.properties b/server/src/test/resources/iotdb-datanode.properties
index 909a83e684..2f1b5cd9b4 100644
--- a/server/src/test/resources/iotdb-datanode.properties
+++ b/server/src/test/resources/iotdb-datanode.properties
@@ -25,4 +25,4 @@ dn_tracing_dir=target/data/tracing
 minimum_schema_file_segment_in_bytes=0
 page_cache_in_schema_file=10
 dn_internal_address=0.0.0.0
-sync_dir=target/sync
+dn_sync_dir=target/sync