yihua commented on code in PR #13650:
URL: https://github.com/apache/hudi/pull/13650#discussion_r2357786720
##########
hudi-client/hudi-client-common/src/test/java/org/apache/hudi/keygen/TestComplexAvroKeyGenerator.java:
##########
@@ -21,37 +21,68 @@
import org.apache.hudi.common.config.TypedProperties;
import org.apache.hudi.common.model.HoodieKey;
import org.apache.hudi.common.testutils.HoodieTestDataGenerator;
+import org.apache.hudi.config.HoodieWriteConfig;
import org.apache.hudi.keygen.constant.KeyGeneratorOptions;
import org.apache.avro.generic.GenericRecord;
-import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.CsvSource;
-import static junit.framework.TestCase.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
public class TestComplexAvroKeyGenerator {
- @Test
- public void testSingleValueKeyGenerator() {
+ @ParameterizedTest
+ @CsvSource(value = {"false,true,8", "true,false,8", "true,true,8",
"false,true,9", "true,false,9", "true,true,9"})
Review Comment:
nit: though this does not affect correctness, the parameters indicate the
expected behavior for readability
```suggestion
@CsvSource(value = {"false,false,8", "true,false,8", "true,true,8",
"false,false,9", "true,false,9", "true,true,9"})
```
##########
hudi-client/hudi-client-common/src/test/java/org/apache/hudi/keygen/TestComplexAvroKeyGenerator.java:
##########
@@ -21,37 +21,68 @@
import org.apache.hudi.common.config.TypedProperties;
import org.apache.hudi.common.model.HoodieKey;
import org.apache.hudi.common.testutils.HoodieTestDataGenerator;
+import org.apache.hudi.config.HoodieWriteConfig;
import org.apache.hudi.keygen.constant.KeyGeneratorOptions;
import org.apache.avro.generic.GenericRecord;
-import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.CsvSource;
-import static junit.framework.TestCase.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
public class TestComplexAvroKeyGenerator {
- @Test
- public void testSingleValueKeyGenerator() {
+ @ParameterizedTest
+ @CsvSource(value = {"false,true,8", "true,false,8", "true,true,8",
"false,true,9", "true,false,9", "true,true,9"})
Review Comment:
Similar for other tests using `boolean setNewEncodingConfig, boolean
encodeSingleKeyFieldValueOnly,`.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]