Skip to content

Commit 43ceba9

Browse files
committed
Convert java.sql.Timestamp to Instant in tests
1 parent 226d8cc commit 43ceba9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/test/java/com/github/shyiko/mysql/binlog/event/deserialization/UpdateRowsEventDataDeserializerTest.java

+6
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ private static void assertEventData(UpdateRowsEventData actual) {
164164
"KxhqLelwG8JyVrzniI6umzs3uew3WyaUMfRyYHYbeRAL5gMxBie4UhXrtlFsd0pE4ogxQYaxRTgjmmFdA3cLkGD0ImWr5jE9P8uzURYcFW9007WctdngXojjLSju0nA5Dhg4ocW73oCNXxxZlcm4FrKKYGG3vfBtoujSwnmoiHPaV8J6SOoqhrAYezQYuqFCbGPEZUYLHiCtdJGR84H8j0uVam3xCSQ1bnKxKhiC6UDmsEiGQ803UwVkmp0BnksV2xXAywpVh5gTtGaONtHU4cjYWNjpp3AOUp20gWf9YKMdKsAlbR7JEVCELoK9QSM7TZcs4jGPz4PPMulHTeS3uOIfM4kUBdrO"
165165
};
166166
Serializable[] oldValues = rows.get(0).getKey();
167+
// Convert to instant to avoid timezone issues.
168+
oldValues[12] = ((Timestamp) oldValues[12]).toInstant();
169+
expectedOldValues[12] = ((Timestamp) expectedOldValues[12]).toInstant();
167170
Assert.assertArrayEquals(expectedOldValues, oldValues);
168171

169172
Serializable[] expectedNewValues = new Serializable[] {
@@ -190,6 +193,9 @@ private static void assertEventData(UpdateRowsEventData actual) {
190193
"KxhqLelwG8JyVrzniI6umzs3uew3WyaUMfRyYHYbeRAL5gMxBie4UhXrtlFsd0pE4ogxQYaxRTgjmmFdA3cLkGD0ImWr5jE9P8uzURYcFW9007WctdngXojjLSju0nA5Dhg4ocW73oCNXxxZlcm4FrKKYGG3vfBtoujSwnmoiHPaV8J6SOoqhrAYezQYuqFCbGPEZUYLHiCtdJGR84H8j0uVam3xCSQ1bnKxKhiC6UDmsEiGQ803UwVkmp0BnksV2xXAywpVh5gTtGaONtHU4cjYWNjpp3AOUp20gWf9YKMdKsAlbR7JEVCELoK9QSM7TZcs4jGPz4PPMulHTeS3uOIfM4kUBdrO"
191194
};
192195
Serializable[] newValues = rows.get(0).getValue();
196+
// Convert to instant to avoid timezone issues.
197+
newValues[12] = ((Timestamp) newValues[12]).toInstant();
198+
expectedNewValues[12] = ((Timestamp) expectedNewValues[12]).toInstant();
193199
Assert.assertArrayEquals(expectedNewValues, newValues);
194200
}
195201
}

0 commit comments

Comments
 (0)