dockerzhang commented on code in PR #7580:
URL: https://github.com/apache/inlong/pull/7580#discussion_r1161640685
##########
inlong-sort/sort-connectors/base/src/test/java/org/apache/inlong/sort/base/dirty/RegexReplaceTest.java:
##########
@@ -21,19 +21,16 @@
import org.junit.Assert;
import org.junit.Test;
-import java.io.IOException;
-
@Slf4j
public class RegexReplaceTest {
@Test
- public void testRegexReplacement() throws IOException {
- String[] identifier = new String[2];
- identifier[0] = "yizhouyang";
- identifier[1] = "table2";
- String pattern = "${database}-${table}-${DIRTY_MESSAGE}";
- String answer = DirtySinkHelper.regexReplace(pattern,
DirtyType.BATCH_LOAD_ERROR, "mock message", identifier[0],
- identifier[1], null);
- Assert.assertEquals("yizhouyang-table2-mock message", answer);
+ public void testRegexReplacement() {
+ String database = "yizhouyang";
Review Comment:
It's better to use another name for the test.
##########
inlong-sort/sort-connectors/base/src/test/java/org/apache/inlong/sort/base/dirty/RegexReplaceTest.java:
##########
@@ -21,19 +21,16 @@
import org.junit.Assert;
import org.junit.Test;
-import java.io.IOException;
-
@Slf4j
public class RegexReplaceTest {
@Test
- public void testRegexReplacement() throws IOException {
- String[] identifier = new String[2];
- identifier[0] = "yizhouyang";
- identifier[1] = "table2";
- String pattern = "${database}-${table}-${DIRTY_MESSAGE}";
- String answer = DirtySinkHelper.regexReplace(pattern,
DirtyType.BATCH_LOAD_ERROR, "mock message", identifier[0],
- identifier[1], null);
- Assert.assertEquals("yizhouyang-table2-mock message", answer);
+ public void testRegexReplacement() {
+ String database = "yizhouyang";
+ String table = "table2";
+ String pattern = "${source.table}-${source.database}-${DIRTY_MESSAGE}";
+ String answer = DirtySinkHelper.regexReplace(pattern,
DirtyType.BATCH_LOAD_ERROR, "mock message", database,
+ table, null);
+ Assert.assertEquals("table2-yizhouyang-mock message", answer);
Review Comment:
ditto
--
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]