Commit 65953fe2 authored by simon824's avatar simon824
Browse files

fix testBuildDataxJobContentJson

parent 24120a46
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -305,7 +305,7 @@ public class DataxTask extends AbstractTask {
        List<ObjectNode> contentList = new ArrayList<>();
        ObjectNode content = JSONUtils.createObjectNode();
        content.put("reader", reader.toString());
        content.put("writer", reader.toString());
        content.put("writer", writer.toString());
        contentList.add(content);

        return contentList;
+2 −4
Original line number Diff line number Diff line
@@ -25,9 +25,7 @@ import java.util.UUID;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.apache.dolphinscheduler.common.enums.CommandType;
import org.apache.dolphinscheduler.common.enums.DbType;
import org.apache.dolphinscheduler.common.task.datax.DataxParameters;
import org.apache.dolphinscheduler.common.utils.JSONUtils;
import org.apache.dolphinscheduler.dao.datasource.BaseDataSource;
import org.apache.dolphinscheduler.dao.datasource.DataSourceFactory;
@@ -316,13 +314,13 @@ public class DataxTaskTest {
            Assert.assertNotNull(contentList);

            ObjectNode content = contentList.get(0);
            JsonNode reader = content.path("reader");
            JsonNode reader = JSONUtils.parseObject(content.path("reader").asText());
            Assert.assertNotNull(reader);

            String readerPluginName = reader.path("name").asText();
            Assert.assertEquals(DataxUtils.DATAX_READER_PLUGIN_MYSQL, readerPluginName);

            JsonNode writer = content.path("writer");
            JsonNode writer = JSONUtils.parseObject(content.path("writer").asText());
            Assert.assertNotNull(writer);

            String writerPluginName = writer.path("name").asText();