From 57222853c90b0ffc4b800adeeddc289d58ee0a25 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 1 Feb 2023 20:22:05 +0300 Subject: Store timestamp in milliseconds when using SQLite --- src/test/java/com/juick/server/tests/ServerTests.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/test/java/com/juick/server') diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java index 62f50b12..4cbc30b5 100644 --- a/src/test/java/com/juick/server/tests/ServerTests.java +++ b/src/test/java/com/juick/server/tests/ServerTests.java @@ -1779,7 +1779,6 @@ public class ServerTests { @Test @Order(20) - @Disabled("Failed on SQLite") public void discussionsShouldBePageableByTimestamp() throws Exception { String msgText = "Привет, я снова Угнич"; int mid = messagesService.createMessage(ugnich.getUid(), msgText, null, Set.of()); @@ -2622,7 +2621,7 @@ public class ServerTests { "SELECT COUNT(*) FROM auth WHERE user_id=?", Integer.class, ugnich.getUid()); assertThat(count, is(1)); var timestamp = Instant.now().minus(3, ChronoUnit.DAYS).atOffset(ZoneOffset.UTC); - jdbcTemplate.update("UPDATE auth SET ts=? WHERE user_id=?", timestamp, ugnich.getUid()); + jdbcTemplate.update("UPDATE auth SET ts=? WHERE user_id=?", ((EmailServiceImpl)emailService).toDateTime(timestamp), ugnich.getUid()); emailService.cleanupAuthCodes(); count = jdbcTemplate.queryForObject( "SELECT COUNT(*) FROM auth WHERE user_id=?", Integer.class, ugnich.getUid()); -- cgit v1.2.3