content: /*
   * Copyright (c)  2022. Aliyun.com All right reserved. This software is the
   * confidential and proprietary information of Aliyun.com ("Confidential
   * Information"). You shall not disclose such Confidential Information and shall
   * use it only in accordance with the terms of the license agreement you entered
   * into with Aliyun.com.
   */
  
  package com.aliyun.fastmodel.compare.merge.impl;
  
  import java.util.ArrayList;
  import java.util.List;
  
  import com.aliyun.fastmodel.core.tree.QualifiedName;
  import com.aliyun.fastmodel.core.tree.expr.Identifier;
  import com.aliyun.fastmodel.core.tree.statement.constants.TableDetailType;
  import com.aliyun.fastmodel.core.tree.statement.table.AddCols;
  import com.aliyun.fastmodel.core.tree.statement.table.ColumnDefinition;
  import com.aliyun.fastmodel.core.tree.statement.table.CreateTable;
  import com.google.common.collect.Lists;
  import org.junit.Test;
  
  import static org.junit.Assert.*;
  
  /**
   * Desc:
   *
   * @author panguanjing
   * @date 2022/10/9
   */
  public class AddColsPipelineTest {
  
      AddColsPipeline addColsPipeline = new AddColsPipeline();
      @Test
      public void process() {
          CreateTable input = CreateTable.builder()
              .detailType(TableDetailType.DWS)
              .tableName(QualifiedName.of("abc"))
              .columns(new ArrayList<>())
              .build();
          List<ColumnDefinition> list = Lists.newArrayList(
              ColumnDefinition.builder()
                  .colName(new Identifier("c1"))
                  .build()
          );
          AddCols baseStatement =new AddCols(QualifiedName.of("abc"), list);
          CreateTable process = addColsPipeline.process(input, baseStatement);
          assertEquals(process.getColumnDefines().size(), 1);
      }
  
  }