19
19
import org .fugerit .java .doc .lib .simpletable .model .SimpleCell ;
20
20
import org .fugerit .java .doc .lib .simpletable .model .SimpleRow ;
21
21
import org .fugerit .java .doc .lib .simpletable .model .SimpleTable ;
22
- import org .junit .Assert ;
23
- import org .junit .Test ;
22
+ import org .junit .jupiter . api . Assertions ;
23
+ import org .junit .jupiter . api . Test ;
24
24
25
- public class TestSimpleTable {
25
+ class TestSimpleTable {
26
26
27
27
private void testTable ( SimpleTable table , SimpleTableHelper helper ) {
28
28
table .addRow ( helper .newHeaderRow ( "H1" , "H2" ) );
@@ -39,51 +39,51 @@ private void testTable( SimpleTable table, SimpleTableHelper helper ) {
39
39
SafeFunction .apply ( () -> {
40
40
try ( ByteArrayOutputStream baos = new ByteArrayOutputStream () ) {
41
41
SimpleTableDocConfig .newConfigLatest ().processSimpleTable ( table , FreeMarkerHtmlTypeHandler .HANDLER , baos );
42
- Assert .assertTrue ( baos .toByteArray ().length > 0 );
42
+ Assertions .assertTrue ( baos .toByteArray ().length > 0 );
43
43
}
44
44
} );
45
- Assert .assertThrows ( DocException .class , () -> {
45
+ Assertions .assertThrows ( DocException .class , () -> {
46
46
try ( ByteArrayOutputStream baos = new ByteArrayOutputStream () ) {
47
47
SimpleTableDocConfig .newConfigLatest ().processSimpleTable ( table , new FailTypeHandler (), baos );
48
- Assert .assertTrue ( baos .toByteArray ().length > 0 );
48
+ Assertions .assertTrue ( baos .toByteArray ().length > 0 );
49
49
}
50
50
} );
51
51
}
52
52
53
53
@ Test
54
- public void testHelper () {
54
+ void testHelper () {
55
55
Integer defaultBorder = 0 ;
56
56
SimpleTableHelper helper = SimpleTableFacade .newHelper ().withDefaultBorderWidth ( defaultBorder );
57
- Assert .assertEquals ( defaultBorder , helper .getDefaultBorderWidth () );
57
+ Assertions .assertEquals ( defaultBorder , helper .getDefaultBorderWidth () );
58
58
List <Integer > lcw = new ArrayList <Integer >();
59
- Assert .assertThrows ( ConfigRuntimeException .class , () -> helper .newTable ( lcw ) );
60
- Assert .assertThrows ( ConfigRuntimeException .class , () -> helper .newTable () );
59
+ Assertions .assertThrows ( ConfigRuntimeException .class , () -> helper .newTable ( lcw ) );
60
+ Assertions .assertThrows ( ConfigRuntimeException .class , () -> helper .newTable () );
61
61
List <Integer > colWidths = null ;
62
- Assert .assertThrows ( ConfigRuntimeException .class , () -> helper .newTable ( colWidths ) );
62
+ Assertions .assertThrows ( ConfigRuntimeException .class , () -> helper .newTable ( colWidths ) );
63
63
Integer [] colWidthsA = null ;
64
- Assert .assertThrows ( ConfigRuntimeException .class , () -> helper .newTable ( colWidthsA ) );
64
+ Assertions .assertThrows ( ConfigRuntimeException .class , () -> helper .newTable ( colWidthsA ) );
65
65
Integer [] colWidths50 = { 20 , 30 };
66
- Assert .assertThrows ( ConfigRuntimeException .class , () -> helper .newTable ( colWidths50 ) );
66
+ Assertions .assertThrows ( ConfigRuntimeException .class , () -> helper .newTable ( colWidths50 ) );
67
67
// new table ok
68
- Assert .assertNotNull ( helper .newTableSingleColumn () );
68
+ Assertions .assertNotNull ( helper .newTableSingleColumn () );
69
69
SimpleTable table = helper .newTable ( 50 , 50 );
70
70
this .testTable (table , helper );
71
71
}
72
72
73
73
@ Test
74
- public void testFacade () {
75
- Assert .assertNotNull ( SimpleTableFacade .newTable ( 100 ) );
76
- Assert .assertNotNull ( SimpleTableFacade .newTableSingleColumn () );
74
+ void testFacade () {
75
+ Assertions .assertNotNull ( SimpleTableFacade .newTable ( 100 ) );
76
+ Assertions .assertNotNull ( SimpleTableFacade .newTableSingleColumn () );
77
77
List <Integer > colW = new ArrayList <>();
78
78
colW .add ( 100 );
79
- Assert .assertNotNull ( SimpleTableFacade .newTable ( colW ) );
79
+ Assertions .assertNotNull ( SimpleTableFacade .newTable ( colW ) );
80
80
}
81
81
82
82
@ Test
83
- public void testCell () {
83
+ void testCell () {
84
84
SimpleCell cell = new SimpleCell ( "test" , 10 ).bold ().bolditalic ().italic ().left ().rigt ().underline ();
85
85
cell .setContent ( "aaaa" );
86
- Assert .assertNotNull ( SimpleCell .newCell ( "bbb" ) );
86
+ Assertions .assertNotNull ( SimpleCell .newCell ( "bbb" ) );
87
87
SimpleRow row = new SimpleRow ();
88
88
row .addCell ( "cccc" );
89
89
row .setHead ( BooleanUtils .BOOLEAN_TRUE );
0 commit comments