You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "danny0405 (via GitHub)" <gi...@apache.org> on 2024/05/01 08:50:03 UTC
Re: [PR] [HUDI-7686] Add tests on the util methods for type cast of configuration instances [hudi]
danny0405 commented on code in PR #11121:
URL: https://github.com/apache/hudi/pull/11121#discussion_r1586035120
##########
hudi-io/src/test/java/org/apache/hudi/io/storage/BaseTestStorageConfiguration.java:
##########
@@ -71,13 +72,25 @@ public abstract class BaseTestStorageConfiguration<T> {
@Test
public void testConstructorNewInstanceUnwrapCopy() {
- T conf = getConf(EMPTY_MAP);
+ T conf = getConf(prepareConfigs());
StorageConfiguration<T> storageConf = getStorageConfiguration(conf);
StorageConfiguration<T> newStorageConf = storageConf.newInstance();
+ Class unwrapperConfClass = storageConf.unwrap().getClass();
assertNotSame(storageConf, newStorageConf);
+ validateConfigs(newStorageConf);
assertNotSame(storageConf.unwrap(), newStorageConf.unwrap());
assertSame(storageConf.unwrap(), storageConf.unwrap());
+ assertSame(storageConf.unwrap(), storageConf.unwrapAs(unwrapperConfClass));
assertNotSame(storageConf.unwrap(), storageConf.unwrapCopy());
+ validateConfigs(getStorageConfiguration(storageConf.unwrapCopy()));
+ assertNotSame(storageConf.unwrap(), storageConf.unwrapCopyAs(unwrapperConfClass));
+ validateConfigs(getStorageConfiguration((T) storageConf.unwrapCopyAs(unwrapperConfClass)));
Review Comment:
Can we add some comments in the assertions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org