From 708c1fea2e47997698c493e13cd16c200d60d276 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 14 Dec 2022 20:00:38 +0300 Subject: Fix the integer overflow issue --- src/test/java/com/juick/server/tests/ServerTests.java | 9 +++++++++ 1 file changed, 9 insertions(+) (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 3a7697e1..d964185d 100644 --- a/src/test/java/com/juick/server/tests/ServerTests.java +++ b/src/test/java/com/juick/server/tests/ServerTests.java @@ -2743,4 +2743,13 @@ public class ServerTests { mockMvc.perform(get(htmlUri).accept(Context.LD_JSON_MEDIA_TYPE)).andExpect(status().is3xxRedirection()) .andExpect(redirectedUrl(ldUri)); } + @Test + @Transactional + public void unsignedOverlowTest() throws Exception { + var result = commandsManager.processCommand(ugnich, "test", emptyUri); + var mid = result.getNewMessage().get().getMid(); + jdbcTemplate.update("UPDATE subscr_messages SET last_read_rid=10 WHERE message_id=?", mid); + assertThat(messagesService.getMessages(ugnich, List.of(mid)).size(), is(1)); + assertThat(messagesService.getMessages(ugnich, List.of(mid)).get(0).isUnread(), is(false)); + } } -- cgit v1.2.3