From 32c7f35bda7ed3bdad93db4cce0dd17e7f48c3bd Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 18 Sep 2019 11:35:55 +0300 Subject: Readonly messages --- src/test/java/com/juick/server/tests/ServerTests.java | 10 ++++++++++ 1 file changed, 10 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 e113c44a..901d1501 100644 --- a/src/test/java/com/juick/server/tests/ServerTests.java +++ b/src/test/java/com/juick/server/tests/ServerTests.java @@ -2211,4 +2211,14 @@ public class ServerTests { .orElseThrow(); assertThat(htmlPM, is(getSnapshot(testPrivateHtmlEmail))); } + @Test + public void readonlyTest() throws Exception { + var result = commandsManager.processCommand(ugnich, "YO", emptyUri); + var mid = result.getNewMessage().get().getMid(); + jdbcTemplate.update("UPDATE messages SET readonly=1 WHERE message_id=?", mid); + var readonlyResult = commandsManager.processCommand(freefd, String.format("#%d PEOPLE", mid), emptyUri); + assertThat(readonlyResult.getNewMessage().isPresent(), is(false)); + var authorResult = commandsManager.processCommand(ugnich, String.format("#%d PEOPLE", mid), emptyUri); + assertThat(authorResult.getNewMessage().isPresent(), is(true)); + } } -- cgit v1.2.3