diff options
author | Vitaly Takmazov | 2023-04-26 09:11:53 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-04-26 09:12:11 +0300 |
commit | 90201606bb485988f5a85cd578f3f5b8ecddf4db (patch) | |
tree | 009e6691d9b32e1cb8605592fcaeed2b8e90977a /src/test/java | |
parent | bd521d4b86f9b3b16caaba714d04e05c2f288847 (diff) |
Expose `friendsOnly` message property over API
Diffstat (limited to 'src/test/java')
-rw-r--r-- | src/test/java/com/juick/MessageTest.java | 2 | ||||
-rw-r--r-- | src/test/java/com/juick/server/tests/ServerTests.java | 7 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/test/java/com/juick/MessageTest.java b/src/test/java/com/juick/MessageTest.java index 9c079fa3..c4aae8d5 100644 --- a/src/test/java/com/juick/MessageTest.java +++ b/src/test/java/com/juick/MessageTest.java @@ -132,7 +132,7 @@ public class MessageTest { assertThat(MessageUtils.getTagsString(message), is(emptyString())); - message.FriendsOnly = true; + message.setFriendsOnly(true); assertThat(MessageUtils.getTagsString(message), is(emptyString())); diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java index e8a90e92..ce9b49d0 100644 --- a/src/test/java/com/juick/server/tests/ServerTests.java +++ b/src/test/java/com/juick/server/tests/ServerTests.java @@ -71,7 +71,6 @@ import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.text.StringEscapeUtils; -import org.apache.http.conn.ssl.TrustSelfSignedStrategy; import org.junit.jupiter.api.*; import org.mockito.ArgumentCaptor; import org.mockito.Captor; @@ -2666,19 +2665,19 @@ public class ServerTests { userService.setPremium(ugnich.getUid(), true); int mid = messagesService.createMessage(ugnich.getUid(), "hidden", "", Collections.emptySet()); var msg = messagesService.getMessage(ugnich.getUid(), mid).orElseThrow(); - assertThat(msg.FriendsOnly, is(false)); + assertThat(msg.isFriendsOnly(), is(false)); mockMvc.perform(post("/api/messages/set_privacy?mid=" + mid) .with(httpBasic(ugnichName, ugnichPassword))) .andExpect(status().isOk()); msg = messagesService.getMessage(ugnich.getUid(), mid).orElseThrow(); - assertThat(msg.FriendsOnly, is(true)); + assertThat(msg.isFriendsOnly(), is(true)); var res = commandsManager.processCommand(freefd, String.format("#%d reply", mid), emptyUri); assertThat(res.getNewMessage(), is(Optional.empty())); mockMvc.perform(post("/api/messages/set_privacy?mid=" + mid) .with(httpBasic(ugnichName, ugnichPassword))) .andExpect(status().isOk()); msg = messagesService.getMessage(ugnich.getUid(), mid).orElseThrow(); - assertThat(msg.FriendsOnly, is(false)); + assertThat(msg.isFriendsOnly(), is(false)); userService.setPremium(ugnich.getUid(), false); mockMvc.perform(post("/api/messages/set_privacy?mid=" + mid) .with(httpBasic(ugnichName, ugnichPassword))) |