diff --git a/hutool-poi/src/test/java/cn/hutool/poi/excel/WriteStyleTest.java b/hutool-poi/src/test/java/cn/hutool/poi/excel/WriteStyleTest.java index eba2ca4c6..192de0273 100644 --- a/hutool-poi/src/test/java/cn/hutool/poi/excel/WriteStyleTest.java +++ b/hutool-poi/src/test/java/cn/hutool/poi/excel/WriteStyleTest.java @@ -2,7 +2,9 @@ package cn.hutool.poi.excel; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.date.DateUtil; +import cn.hutool.poi.excel.cell.CellSetter; import cn.hutool.poi.excel.style.StyleUtil; +import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.Font; import org.junit.Ignore; @@ -32,6 +34,11 @@ public class WriteStyleTest { writer.write(rows); + writer.writeCellValue(0, 0, (CellSetter) cell -> { + cell.setCellStyle(cellStyle); + cell.setCellValue("1234"); + }); + for (int i = 0; i < writer.getRowCount(); i++) { writer.setStyle(cellStyle, 2, i); }