From 1695469b2c2d0f72ef63ad72070a464e42b2086a Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 15 Feb 2023 23:56:05 +0300 Subject: Parse old Pidgin urls --- src/test/java/com/juick/server/tests/ServerTests.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (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 f297ee2e..e97f4a20 100644 --- a/src/test/java/com/juick/server/tests/ServerTests.java +++ b/src/test/java/com/juick/server/tests/ServerTests.java @@ -122,7 +122,6 @@ import java.nio.file.*; import java.security.NoSuchAlgorithmException; import java.security.NoSuchProviderException; import java.security.spec.InvalidKeySpecException; -import java.sql.Timestamp; import java.time.Instant; import java.time.ZoneOffset; import java.time.temporal.ChronoUnit; @@ -234,6 +233,8 @@ public class ServerTests { private Resource sapeOutput; @Value("classpath:friendica_update.json") private Resource friendicaUpdate; + @Value("classpath:message_group_reference.json") + private Resource groupReferenceMessage; @Inject AppleClientSecretGenerator clientSecretGenerator; @Inject @@ -2651,4 +2652,12 @@ public class ServerTests { assertThat(tagService.getTag(first, true).getName(), is(first)); assertThat(tagService.getTag(second, true).getName(), is(second)); } + @Test + public void testPidginLinks() throws IOException { + String msgData = IOUtils.toString(groupReferenceMessage.getInputStream(), StandardCharsets.UTF_8); + Message msg = jsonMapper.readValue(msgData, Message.class); + String output = MessageUtils.formatMessage(msg.getText()); + assertThat(output, is("К вопросу об опросах типа \"За кого бы вы проголосовали\" и \"Согласны ли вы с результатами\"...
\n" + + "Напоминает один старый опрос: опрос на сайте www.$somesite$.ru показал, что 100% Россиян использует интернет.")); + } } -- cgit v1.2.3