@@ -22,7 +22,7 @@ class DebeziumConverterUtilsTest {
22
22
@ Test
23
23
public void convertDefaultValueTest () {
24
24
25
- RelationalColumn relationalColumn = mock (RelationalColumn .class );
25
+ final RelationalColumn relationalColumn = mock (RelationalColumn .class );
26
26
27
27
when (relationalColumn .isOptional ()).thenReturn (true );
28
28
Object actualColumnDefaultValue = DebeziumConverterUtils .convertDefaultValue (relationalColumn );
@@ -35,67 +35,67 @@ public void convertDefaultValueTest() {
35
35
36
36
when (relationalColumn .isOptional ()).thenReturn (false );
37
37
when (relationalColumn .hasDefaultValue ()).thenReturn (true );
38
- String expectedColumnDefaultValue = "default value" ;
38
+ final String expectedColumnDefaultValue = "default value" ;
39
39
when (relationalColumn .defaultValue ()).thenReturn (expectedColumnDefaultValue );
40
40
actualColumnDefaultValue = DebeziumConverterUtils .convertDefaultValue (relationalColumn );
41
41
Assertions .assertEquals (actualColumnDefaultValue , expectedColumnDefaultValue );
42
42
}
43
43
44
44
@ Test
45
45
public void convertLocalDate () {
46
- LocalDate localDate = LocalDate .of (2021 , 1 , 1 );
46
+ final LocalDate localDate = LocalDate .of (2021 , 1 , 1 );
47
47
48
- String actual = DebeziumConverterUtils .convertDate (localDate );
48
+ final String actual = DebeziumConverterUtils .convertDate (localDate );
49
49
Assertions .assertEquals ("2021-01-01T00:00:00Z" , actual );
50
50
}
51
51
52
52
@ Test
53
53
public void convertTLocalTime () {
54
- LocalTime localTime = LocalTime .of (8 , 1 , 1 );
55
- String actual = DebeziumConverterUtils .convertDate (localTime );
54
+ final LocalTime localTime = LocalTime .of (8 , 1 , 1 );
55
+ final String actual = DebeziumConverterUtils .convertDate (localTime );
56
56
Assertions .assertEquals ("08:01:01" , actual );
57
57
}
58
58
59
59
@ Test
60
60
public void convertLocalDateTime () {
61
- LocalDateTime localDateTime = LocalDateTime .of (2021 , 1 , 1 , 8 , 1 , 1 );
61
+ final LocalDateTime localDateTime = LocalDateTime .of (2021 , 1 , 1 , 8 , 1 , 1 );
62
62
63
- String actual = DebeziumConverterUtils .convertDate (localDateTime );
63
+ final String actual = DebeziumConverterUtils .convertDate (localDateTime );
64
64
Assertions .assertEquals ("2021-01-01T08:01:01Z" , actual );
65
65
}
66
66
67
67
@ Test
68
68
@ Disabled
69
69
public void convertDuration () {
70
- Duration duration = Duration .ofHours (100_000 );
70
+ final Duration duration = Duration .ofHours (100_000 );
71
71
72
- String actual = DebeziumConverterUtils .convertDate (duration );
72
+ final String actual = DebeziumConverterUtils .convertDate (duration );
73
73
Assertions .assertEquals ("1981-05-29T20:00:00Z" , actual );
74
74
}
75
75
76
76
@ Test
77
77
public void convertTimestamp () {
78
- LocalDateTime localDateTime = LocalDateTime .of (2021 , 1 , 1 , 8 , 1 , 1 );
79
- Timestamp timestamp = Timestamp .valueOf (localDateTime );
78
+ final LocalDateTime localDateTime = LocalDateTime .of (2021 , 1 , 1 , 8 , 1 , 1 );
79
+ final Timestamp timestamp = Timestamp .valueOf (localDateTime );
80
80
81
- String actual = DebeziumConverterUtils .convertDate (timestamp );
82
- Assertions .assertEquals ("2021-01-01T08:01:01Z " , actual );
81
+ final String actual = DebeziumConverterUtils .convertDate (timestamp );
82
+ Assertions .assertEquals ("2021-01-01T08:01:01.000000Z " , actual );
83
83
}
84
84
85
85
@ Test
86
86
@ Disabled
87
87
public void convertNumber () {
88
- Number number = 100_000 ;
88
+ final Number number = 100_000 ;
89
89
90
- String actual = DebeziumConverterUtils .convertDate (number );
90
+ final String actual = DebeziumConverterUtils .convertDate (number );
91
91
Assertions .assertEquals ("1970-01-01T03:01:40Z" , actual );
92
92
}
93
93
94
94
@ Test
95
95
public void convertStringDateFormat () {
96
- String stringValue = "2021-01-01T00:00:00Z" ;
96
+ final String stringValue = "2021-01-01T00:00:00Z" ;
97
97
98
- String actual = DebeziumConverterUtils .convertDate (stringValue );
98
+ final String actual = DebeziumConverterUtils .convertDate (stringValue );
99
99
Assertions .assertEquals ("2021-01-01T00:00:00Z" , actual );
100
100
}
101
101
0 commit comments