diff options
Diffstat (limited to 'juick-server')
-rw-r--r-- | juick-server/build.gradle | 1 | ||||
-rw-r--r-- | juick-server/src/test/java/com/juick/tests/util/MockUtils.java | 5 |
2 files changed, 4 insertions, 2 deletions
diff --git a/juick-server/build.gradle b/juick-server/build.gradle index 8f23e8db..9a093d04 100644 --- a/juick-server/build.gradle +++ b/juick-server/build.gradle @@ -23,6 +23,7 @@ dependencies { compile "org.apache.httpcomponents:httpclient:4.5.3" providedCompile "org.apache.commons:commons-lang3:3.6" providedCompile "org.apache.commons:commons-collections4:4.1" + providedCompile "org.apache.commons:commons-text:1.1" providedCompile "commons-io:commons-io:2.5" providedCompile "commons-codec:commons-codec:1.10" diff --git a/juick-server/src/test/java/com/juick/tests/util/MockUtils.java b/juick-server/src/test/java/com/juick/tests/util/MockUtils.java index c67b26ef..5344dd23 100644 --- a/juick-server/src/test/java/com/juick/tests/util/MockUtils.java +++ b/juick-server/src/test/java/com/juick/tests/util/MockUtils.java @@ -2,7 +2,7 @@ package com.juick.tests.util; import com.juick.Message; import com.juick.User; -import org.apache.commons.lang3.RandomStringUtils; +import org.apache.commons.text.RandomStringGenerator; import java.util.Date; @@ -10,12 +10,13 @@ import java.util.Date; * Created by vitalyster on 12.01.2017. */ public class MockUtils { + final static RandomStringGenerator generator = new RandomStringGenerator.Builder().withinRange('a', 'z').build(); public static Message mockMessage(Integer mid, final User user, final String messageText) { Message msg = new Message(); msg.setMid(mid); msg.setUser(user); - msg.setText(messageText == null ? RandomStringUtils.randomAlphanumeric(24) : messageText); + msg.setText(messageText == null ? generator.generate(24) : messageText); msg.setDate(new Date()); return msg; } |