diff options
author | Vitaly Takmazov | 2024-05-12 14:58:27 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2024-05-12 15:08:24 +0300 |
commit | 986cdeb72a6d433b43c990293b8a9d5689e3584b (patch) | |
tree | dcdf449747d642b7aa5595c6ac5b8359834263ee /src/test/java/com/juick/server/tests | |
parent | 917744962bfa182345e2c743b2bdce97811e82f9 (diff) |
StringUtils.abbreviate
Diffstat (limited to 'src/test/java/com/juick/server/tests')
-rw-r--r-- | src/test/java/com/juick/server/tests/ServerTests.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java index d61725e6..3bfbf6d4 100644 --- a/src/test/java/com/juick/server/tests/ServerTests.java +++ b/src/test/java/com/juick/server/tests/ServerTests.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2019, Juick + * Copyright (C) 2008-2024, Juick * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -38,7 +38,10 @@ import com.juick.service.*; import com.juick.service.activities.UpdateEvent; import com.juick.service.component.SystemEvent; import com.juick.test.util.MockUtils; -import com.juick.util.*; +import com.juick.util.DateFormattersHolder; +import com.juick.util.HttpUtils; +import com.juick.util.MessageUtils; +import com.juick.util.WebUtils; import com.juick.util.formatters.PlainTextFormatter; import com.juick.www.WebApp; import com.juick.www.ad.models.Site; @@ -119,9 +122,6 @@ import java.io.*; import java.net.URI; import java.nio.charset.StandardCharsets; import java.nio.file.*; -import java.security.NoSuchAlgorithmException; -import java.security.NoSuchProviderException; -import java.security.spec.InvalidKeySpecException; import java.time.Instant; import java.time.ZoneOffset; import java.time.temporal.ChronoUnit; @@ -2696,8 +2696,8 @@ public class ServerTests { @Test public void textTruncationShouldNotBreakEmojis() { var text = "Так ты же написал, чтоб я сам поправил отступ \uD83D\uDE00\n"; - var expected = "Так ты же написал, чтоб я сам поправил отступ"; - var truncated = PlainTextFormatter.truncateText(text, 47); + var expected = "Так ты же написал, чтоб я сам поправил отступ …"; + var truncated = StringUtils.abbreviate(text, "…", 47); assertThat(truncated, is(expected)); } } |