From 384c61ceae3301c6bc92ee6f591ed9d186b15204 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sat, 6 Apr 2019 21:53:13 +0300 Subject: Message properties --- src/test/java/com/juick/server/tests/ServerTests.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/test/java') diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java index d4f79f3e..afe7f659 100644 --- a/src/test/java/com/juick/server/tests/ServerTests.java +++ b/src/test/java/com/juick/server/tests/ServerTests.java @@ -106,7 +106,6 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import java.io.*; import java.net.URI; -import java.net.URISyntaxException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; @@ -141,8 +140,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT) @TestPropertySource(properties = { "broken_ssl_hosts=localhost,serverstorageisfull.tld", - "ios_app_id=12345678.com.juick.ExampleApp", - "spring.jackson.default-property-inclusion=non_default" + "ios_app_id=12345678.com.juick.ExampleApp" }) @AutoConfigureMockMvc public class ServerTests { @@ -178,8 +176,6 @@ public class ServerTests { @Inject private CrosspostService crosspostService; @Inject - private ImagesService imagesService; - @Inject private ServerManager serverManager; @Inject private KeystoreManager keystoreManager; @@ -2020,4 +2016,14 @@ public class ServerTests { User user = userService.getUserByUID(0).orElse(AnonymousUser.INSTANCE); assertThat(user.isAnonymous(), is(true)); } + @Test + public void messagePropertiesTest() { + int mid = messagesService.createMessage(ugnich.getUid(), "YO", null, null); + messagesService.setMessageProperty(mid, "tg_id", "YO"); + assertThat(messagesService.getMessageProperty(mid, "tg_id"), is("YO")); + messagesService.setMessageProperty(mid, "tg_id", "YO2"); + assertThat(messagesService.getMessageProperty(mid, "tg_id"), is("YO2")); + messagesService.setMessageProperty(mid, "tg_id", ""); + assertThat(messagesService.getMessageProperty(mid, "tg_id"), is(StringUtils.EMPTY)); + } } -- cgit v1.2.3