Skip to content

Commit 28ec2e9

Browse files
committed
Add a unit test
1 parent 102f14f commit 28ec2e9

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

hudi-client/hudi-client-common/src/test/java/org/apache/hudi/keygen/TestKeyGenUtils.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,19 @@ public class TestKeyGenUtils {
2727
public void testExtractRecordKeys() {
2828
// test complex key form: field1:val1,field2:val2,...
2929
String[] s1 = KeyGenUtils.extractRecordKeys("id:1");
30-
Assertions.assertArrayEquals(new String[]{"1"}, s1);
30+
Assertions.assertArrayEquals(new String[] {"1"}, s1);
3131

3232
String[] s2 = KeyGenUtils.extractRecordKeys("id:1,id:2");
33-
Assertions.assertArrayEquals(new String[]{"1", "2"}, s2);
33+
Assertions.assertArrayEquals(new String[] {"1", "2"}, s2);
3434

3535
String[] s3 = KeyGenUtils.extractRecordKeys("id:1,id2:__null__,id3:__empty__");
36-
Assertions.assertArrayEquals(new String[]{"1", null, ""}, s3);
36+
Assertions.assertArrayEquals(new String[] {"1", null, ""}, s3);
37+
38+
String[] s4 = KeyGenUtils.extractRecordKeys("id:ab:cd,id2:ef");
39+
Assertions.assertArrayEquals(new String[] {"ab:cd", "ef"}, s4);
3740

3841
// test simple key form: val1
39-
String[] s4 = KeyGenUtils.extractRecordKeys("1");
40-
Assertions.assertArrayEquals(new String[]{"1"}, s4);
42+
String[] s5 = KeyGenUtils.extractRecordKeys("1");
43+
Assertions.assertArrayEquals(new String[] {"1"}, s5);
4144
}
4245
}

0 commit comments

Comments
 (0)