From 556d10c400add4b69d8832a40fb704fda4333080 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sat, 28 Jan 2023 01:46:13 +0300 Subject: Improve SQL server compatibility --- src/test/java/com/juick/server/tests/ServerTests.java | 2 +- src/test/resources/application-sqlserver.yml | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 src/test/resources/application-sqlserver.yml (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 d695ffb8..ea1e6100 100644 --- a/src/test/java/com/juick/server/tests/ServerTests.java +++ b/src/test/java/com/juick/server/tests/ServerTests.java @@ -1599,7 +1599,7 @@ public class ServerTests { assertThat(messagesService.recommendMessage(mid, pogo.getUid()), is(MessagesService.RecommendStatus.Added)); jdbcTemplate.update("INSERT INTO favorites(user_id, user_uri, message_id, like_id, ts) " - + "values (0, 'http://example.com/u/test', ?, 1, now())", mid); + + "values (0, 'http://example.com/u/test', ?, 1, ?)", mid, Date.from(Instant.now())); assertThat(messagesService.getMessage(mid).get().getRecommendations().size(), is(4)); assertThat(CollectionUtils.isEqualCollection( messagesService.getMessagesRecommendations(Collections.singletonList(mid)).stream() diff --git a/src/test/resources/application-sqlserver.yml b/src/test/resources/application-sqlserver.yml new file mode 100644 index 00000000..f195bcae --- /dev/null +++ b/src/test/resources/application-sqlserver.yml @@ -0,0 +1,12 @@ +spring: + datasource: + url: jdbc:sqlserver://localhost:1433;databaseName=tempdb;encrypt=false;SelectMethod=Cursor + username: sa + password: Passw00rd! + flyway: + baseline-on-migrate: true + sql: + init: + platform: sqlserver + mode: always + -- cgit v1.2.3