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 +-- src/test/resources/application-sqlite.yml | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'src/test') 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()); diff --git a/src/test/resources/application-sqlite.yml b/src/test/resources/application-sqlite.yml index 6a838f13..6a9c0516 100644 --- a/src/test/resources/application-sqlite.yml +++ b/src/test/resources/application-sqlite.yml @@ -5,7 +5,6 @@ spring: url: jdbc:sqlite:data.db sql: init: - separator: ;; platform: sqlite mode: always -- cgit v1.2.3