This is an automated email from the ASF dual-hosted git repository.
chengzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 54634b276dc Fix test cases of ShardingSphereURLProvider (#30117)
54634b276dc is described below
commit 54634b276dce5b5f1ff647960b538520dca3cdb8
Author: Liang Zhang <[email protected]>
AuthorDate: Wed Feb 14 02:42:53 2024 +0800
Fix test cases of ShardingSphereURLProvider (#30117)
---
.../spi/absolutepath/AbsolutePathWithEnvironmentURLProviderTest.java | 2 +-
.../driver/spi/classpath/ClasspathWithEnvironmentURLProviderTest.java | 3 ++-
.../driver/spi/classpath/ClasspathWithSystemPropsURLProviderTest.java | 3 ++-
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git
a/jdbc/core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/driver/spi/absolutepath/AbsolutePathWithEnvironmentURLProviderTest.java
b/jdbc/core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/driver/spi/absolutepath/AbsolutePathWithEnvironmentURLProviderTest.java
index ca20181bb03..c25e38e5c33 100644
---
a/jdbc/core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/driver/spi/absolutepath/AbsolutePathWithEnvironmentURLProviderTest.java
+++
b/jdbc/core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/driver/spi/absolutepath/AbsolutePathWithEnvironmentURLProviderTest.java
@@ -38,7 +38,7 @@ class AbsolutePathWithEnvironmentURLProviderTest {
String absoluteOriginPath =
Objects.requireNonNull(Thread.currentThread().getContextClassLoader().getResource("config/driver/foo-driver-fixture.yaml")).getPath();
byte[] actualOrigin =
ShardingSphereURLManager.getContent("jdbc:shardingsphere:absolutepath:" +
absoluteOriginPath, urlPrefix);
String absolutePath =
Objects.requireNonNull(Thread.currentThread().getContextClassLoader().getResource("config/driver/foo-driver-environment-variables-fixture.yaml")).getPath();
- byte[] actual =
spy.getContent("jdbc:shardingsphere:absolutepath-environment:" + absolutePath,
urlPrefix);
+ byte[] actual =
spy.getContent("jdbc:shardingsphere:absolutepath-environment:" + absolutePath,
absolutePath);
assertThat(actual, is(actualOrigin));
}
}
diff --git
a/jdbc/core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/driver/spi/classpath/ClasspathWithEnvironmentURLProviderTest.java
b/jdbc/core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/driver/spi/classpath/ClasspathWithEnvironmentURLProviderTest.java
index 019c4500823..9b9cae43d3f 100644
---
a/jdbc/core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/driver/spi/classpath/ClasspathWithEnvironmentURLProviderTest.java
+++
b/jdbc/core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/driver/spi/classpath/ClasspathWithEnvironmentURLProviderTest.java
@@ -33,7 +33,8 @@ class ClasspathWithEnvironmentURLProviderTest {
ClasspathWithEnvironmentURLProvider spy = spy(new
ClasspathWithEnvironmentURLProvider());
when(spy.getEnvironmentVariables("FIXTURE_JDBC_URL")).thenReturn("jdbc:h2:mem:foo_ds_1;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MySQL");
when(spy.getEnvironmentVariables("FIXTURE_USERNAME")).thenReturn("sa");
- byte[] actual =
spy.getContent("jdbc:shardingsphere:classpath-environment:config/driver/foo-driver-environment-variables-fixture.yaml",
urlPrefix);
+ byte[] actual =
spy.getContent("jdbc:shardingsphere:classpath-environment:config/driver/foo-driver-environment-variables-fixture.yaml",
+ "config/driver/foo-driver-environment-variables-fixture.yaml");
byte[] actualOrigin =
ShardingSphereURLManager.getContent("jdbc:shardingsphere:classpath:config/driver/foo-driver-fixture.yaml",
urlPrefix);
assertThat(actual, is(actualOrigin));
}
diff --git
a/jdbc/core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/driver/spi/classpath/ClasspathWithSystemPropsURLProviderTest.java
b/jdbc/core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/driver/spi/classpath/ClasspathWithSystemPropsURLProviderTest.java
index 18cbab3a5d4..c5b452d9317 100644
---
a/jdbc/core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/driver/spi/classpath/ClasspathWithSystemPropsURLProviderTest.java
+++
b/jdbc/core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/driver/spi/classpath/ClasspathWithSystemPropsURLProviderTest.java
@@ -50,7 +50,8 @@ class ClasspathWithSystemPropsURLProviderTest {
void assertReplaceEnvironmentVariables() {
final String urlPrefix = "jdbc:shardingsphere:";
ClasspathWithSystemPropsURLProvider urlProvider = new
ClasspathWithSystemPropsURLProvider();
- byte[] actual =
urlProvider.getContent("jdbc:shardingsphere:classpath-system-props:config/driver/foo-driver-system-properties-fixture.yaml",
urlPrefix);
+ byte[] actual =
urlProvider.getContent("jdbc:shardingsphere:classpath-system-props:config/driver/foo-driver-system-properties-fixture.yaml",
+ "config/driver/foo-driver-system-properties-fixture.yaml");
byte[] actualOrigin =
ShardingSphereURLManager.getContent("jdbc:shardingsphere:classpath:config/driver/foo-driver-fixture.yaml",
urlPrefix);
assertThat(actual, is(actualOrigin));
}