diff --git a/excel-importer-test/src_test/com/axonivy/util/excel/test/TestExcelReader.java b/excel-importer-test/src_test/com/axonivy/util/excel/test/TestExcelReader.java index 5d0471e..1d6fe91 100644 --- a/excel-importer-test/src_test/com/axonivy/util/excel/test/TestExcelReader.java +++ b/excel-importer-test/src_test/com/axonivy/util/excel/test/TestExcelReader.java @@ -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; @@ -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 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)); + } } diff --git a/excel-importer-test/src_test/com/axonivy/util/excel/test/sample_over_255_characters.xlsx b/excel-importer-test/src_test/com/axonivy/util/excel/test/sample_over_255_characters.xlsx new file mode 100644 index 0000000..61eb94f Binary files /dev/null and b/excel-importer-test/src_test/com/axonivy/util/excel/test/sample_over_255_characters.xlsx differ