Skip to content

Commit

Permalink
MARP-1315 Update UT
Browse files Browse the repository at this point in the history
  • Loading branch information
tvtphuc-axonivy committed Nov 6, 2024
1 parent 3bbba42 commit a075ff8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
import java.nio.file.Path;
import java.sql.Timestamp;
import java.util.List;

import org.apache.poi.ss.usermodel.Workbook;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;

import com.axonivy.util.excel.importer.Column;
import com.axonivy.util.excel.importer.ExcelLoader;
import com.axonivy.util.excel.importer.ExcelReader;
Expand All @@ -33,5 +31,17 @@ void parseColumns_xlsx(@TempDir Path dir) throws IOException {
new Column("Column contains both text and numeric", String.class, 255)
);
}

@Test
void parseColumnsOver255Characters_xlsx(@TempDir Path dir) throws IOException {
Path path = dir.resolve("customers.xlsx");
TstRes.loadTo(path, "sample_over_255_characters.xlsx");
Workbook wb = ExcelLoader.load(path);
List<Column> columns = ExcelReader.parseColumns(wb.getSheetAt(0));
assertThat(columns).extracting(Column::getName).contains("FirstName", "LastName" , "Summary");
assertThat(columns).contains(new Column("FirstName", String.class, 255),
new Column("LastName", String.class, 255),
new Column("Summary", String.class, 823));
}

}
Binary file not shown.

0 comments on commit a075ff8

Please sign in to comment.