This is an automated email from the ASF dual-hosted git repository.
zhangliang 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 671636ce9a2 Refactor DefaultAESPropertiesProviderTest (#37019)
671636ce9a2 is described below
commit 671636ce9a2fb39495c08cddd7d9fe8f2557e5ed
Author: Liang Zhang <[email protected]>
AuthorDate: Thu Nov 6 10:44:39 2025 +0800
Refactor DefaultAESPropertiesProviderTest (#37019)
---
.../cryptographic/aes/props/DefaultAESPropertiesProviderTest.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git
a/infra/algorithm/type/cryptographic/type/aes/src/test/java/org/apache/shardingsphere/infra/algorithm/cryptographic/aes/props/DefaultAESPropertiesProviderTest.java
b/infra/algorithm/type/cryptographic/type/aes/src/test/java/org/apache/shardingsphere/infra/algorithm/cryptographic/aes/props/DefaultAESPropertiesProviderTest.java
index ba420ed547a..e98929b1583 100644
---
a/infra/algorithm/type/cryptographic/type/aes/src/test/java/org/apache/shardingsphere/infra/algorithm/cryptographic/aes/props/DefaultAESPropertiesProviderTest.java
+++
b/infra/algorithm/type/cryptographic/type/aes/src/test/java/org/apache/shardingsphere/infra/algorithm/cryptographic/aes/props/DefaultAESPropertiesProviderTest.java
@@ -30,14 +30,16 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
class DefaultAESPropertiesProviderTest {
+ private static final String DEFAULT_AES = "DEFAULT";
+
@Test
void assertCreateNewInstanceWithoutAESKey() {
- assertThrows(AlgorithmInitializationException.class, () ->
TypedSPILoader.getService(CryptographicPropertiesProvider.class, "DEFAULT"));
+ assertThrows(AlgorithmInitializationException.class, () ->
TypedSPILoader.getService(CryptographicPropertiesProvider.class, DEFAULT_AES));
}
@Test
void assertCreateNewInstanceWithAESKey() {
- CryptographicPropertiesProvider provider =
TypedSPILoader.getService(CryptographicPropertiesProvider.class, "DEFAULT",
+ CryptographicPropertiesProvider provider =
TypedSPILoader.getService(CryptographicPropertiesProvider.class, DEFAULT_AES,
PropertiesBuilder.build(new Property("aes-key-value", "test"),
new Property("digest-algorithm-name", "SHA-1")));
assertThat(provider.getSecretKey().length, is(16));
assertThat(provider.getMode(), is(""));