12
12
import org .fugerit .java .doc .base .model .DocCell ;
13
13
import org .fugerit .java .doc .mod .poi .PoiUtils ;
14
14
import org .fugerit .java .doc .mod .poi .WorkbookHelper ;
15
- import org .junit .Assert ;
16
- import org .junit .Test ;
17
15
18
16
import lombok .extern .slf4j .Slf4j ;
17
+ import org .junit .jupiter .api .Assertions ;
18
+ import org .junit .jupiter .api .Test ;
19
19
20
20
@ Slf4j
21
- public class TestPOIUtils {
21
+ class TestPOIUtils {
22
22
23
23
24
24
@ Test
25
- public void xlsxFormatStyle () {
26
- Assert .assertTrue ( SafeFunction .get ( () -> {
25
+ void xlsxFormatStyle () {
26
+ Assertions .assertTrue ( SafeFunction .get ( () -> {
27
27
boolean ok = Boolean .TRUE ;
28
28
PoiUtils .xlsxFormatStyle (null , null , null );
29
29
PoiUtils .xlsxFormatStyle (null , new XSSFCellStyle ( null ), null );
@@ -32,17 +32,17 @@ public void xlsxFormatStyle() {
32
32
}
33
33
34
34
@ Test
35
- public void xlsxFontStyle () {
36
- Assert .assertTrue ( SafeFunction .get ( () -> {
35
+ void xlsxFontStyle () {
36
+ Assertions .assertTrue ( SafeFunction .get ( () -> {
37
37
boolean ok = Boolean .TRUE ;
38
38
PoiUtils .xlsxFontStyle (null , null , null );
39
39
return ok ;
40
40
} ) );
41
41
}
42
42
43
43
@ Test
44
- public void lsxFormat () {
45
- Assert .assertTrue ( SafeFunction .get ( () -> {
44
+ void lsxFormat () {
45
+ Assertions .assertTrue ( SafeFunction .get ( () -> {
46
46
boolean ok = Boolean .TRUE ;
47
47
try ( InputStream is = ClassHelper .loadFromDefaultClassLoader ( "coverage/xls_as_xls.xls" );
48
48
HSSFWorkbook workbook = new HSSFWorkbook ( is ) ) {
@@ -56,9 +56,9 @@ public void lsxFormat() {
56
56
}
57
57
58
58
@ Test
59
- public void testFindColor () {
59
+ void testFindColor () {
60
60
Short test = 31 ;
61
- Assert .assertEquals ( test , SafeFunction .get ( () -> {
61
+ Assertions .assertEquals ( test , SafeFunction .get ( () -> {
62
62
try ( InputStream is = ClassHelper .loadFromDefaultClassLoader ( "coverage/xls_as_xls.xls" );
63
63
HSSFWorkbook workbook = new HSSFWorkbook ( is ) ) {
64
64
short index = PoiUtils .findClosestColorIndex ( workbook , "#dddddd" );
@@ -69,15 +69,15 @@ public void testFindColor() {
69
69
}
70
70
71
71
@ Test
72
- public void testNewHelper () {
72
+ void testNewHelper () {
73
73
SafeFunction .apply ( () -> {
74
74
try ( InputStream is = ClassHelper .loadFromDefaultClassLoader ( "coverage/xls_as_xls.xls" );
75
75
WorkbookHelper helper = PoiUtils .newHelper ( false , is ) ) {
76
76
log .info ( "test 1 -> {}" , helper .getIndexedColorMap () );
77
- Assert .assertNotNull ( helper );
77
+ Assertions .assertNotNull ( helper );
78
78
}
79
79
} );
80
- Assert .assertNotNull ( SafeFunction .get ( () -> {
80
+ Assertions .assertNotNull ( SafeFunction .get ( () -> {
81
81
try ( InputStream is = ClassHelper .loadFromDefaultClassLoader ( "coverage/xlsx_as_xlsx.xlsx" );
82
82
WorkbookHelper helper = PoiUtils .newHelper ( true , is ) ) {
83
83
log .info ( "test 2 -> {}" , helper .getIndexedColorMap () );
@@ -89,10 +89,10 @@ public void testNewHelper() {
89
89
private static final IOException FAIL_EX = new IOException ( "scenario exception" );
90
90
91
91
@ Test
92
- public void testAutoresizeFailhandler () {
92
+ void testAutoresizeFailhandler () {
93
93
PoiUtils .autoresizeFailHandler ( false ).accept ( FAIL_EX );
94
94
Consumer <Exception > exHandlerFail = PoiUtils .autoresizeFailHandler ( true );
95
- Assert .assertThrows ( ConfigRuntimeException .class , () -> exHandlerFail .accept ( FAIL_EX ) );
95
+ Assertions .assertThrows ( ConfigRuntimeException .class , () -> exHandlerFail .accept ( FAIL_EX ) );
96
96
}
97
97
98
98
}
0 commit comments