You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ro...@apache.org on 2022/10/11 15:58:49 UTC
[activemq-artemis] branch main updated: ARTEMIS-4037 Use random alphanumeric strings for MQTTRetainMessageManagerTest
This is an automated email from the ASF dual-hosted git repository.
robbie pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git
The following commit(s) were added to refs/heads/main by this push:
new 5a42de5fa6 ARTEMIS-4037 Use random alphanumeric strings for MQTTRetainMessageManagerTest
new 716d5ae659 This closes #4252
5a42de5fa6 is described below
commit 5a42de5fa6ee1b96f6f3e404f5a3d11a702e1776
Author: Domenico Francesco Bruscino <br...@apache.org>
AuthorDate: Tue Oct 11 10:24:03 2022 +0200
ARTEMIS-4037 Use random alphanumeric strings for MQTTRetainMessageManagerTest
---
artemis-protocols/artemis-mqtt-protocol/pom.xml | 6 ------
.../artemis/core/protocol/mqtt/MQTTRetainMessageManagerTest.java | 8 ++------
2 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/artemis-protocols/artemis-mqtt-protocol/pom.xml b/artemis-protocols/artemis-mqtt-protocol/pom.xml
index 7a98856183..50e08ec8da 100644
--- a/artemis-protocols/artemis-mqtt-protocol/pom.xml
+++ b/artemis-protocols/artemis-mqtt-protocol/pom.xml
@@ -115,12 +115,6 @@
<artifactId>org.eclipse.paho.mqttv5.client</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>com.github.javafaker</groupId>
- <artifactId>javafaker</artifactId>
- <version>0.15</version>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
diff --git a/artemis-protocols/artemis-mqtt-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTRetainMessageManagerTest.java b/artemis-protocols/artemis-mqtt-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTRetainMessageManagerTest.java
index e21c63b658..f54f66aeba 100644
--- a/artemis-protocols/artemis-mqtt-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTRetainMessageManagerTest.java
+++ b/artemis-protocols/artemis-mqtt-protocol/src/test/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTRetainMessageManagerTest.java
@@ -33,6 +33,7 @@ import org.apache.activemq.artemis.core.server.MessageReference;
import org.apache.activemq.artemis.core.server.Queue;
import org.apache.activemq.artemis.junit.EmbeddedJMSResource;
import org.apache.activemq.artemis.utils.collections.LinkedListIterator;
+import org.apache.commons.lang3.RandomStringUtils;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.junit.After;
@@ -44,9 +45,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.lang.invoke.MethodHandles;
-import com.github.javafaker.ChuckNorris;
-import com.github.javafaker.Faker;
-
@SuppressWarnings("deprecation")
public class MQTTRetainMessageManagerTest {
@@ -74,8 +72,6 @@ public class MQTTRetainMessageManagerTest {
private final String topic = "fact";
- private final ChuckNorris chuckNorris = (new Faker()).chuckNorris();
-
private final int numberOfMessages = 1000;
private final int numberOfTests = 10;
@@ -186,7 +182,7 @@ public class MQTTRetainMessageManagerTest {
protected void publish(final int qos) throws MqttException {
mqttConsumerCount.subscribe(topic, qos);
IntStream.range(0, numberOfMessages).forEach(i -> {
- final String fact = String.format("[%s] %s", i, chuckNorris.fact());
+ final String fact = String.format("[%s] %s", i, RandomStringUtils.randomAlphanumeric(128));
final MqttMessage message = message(fact, qos, true);
mqttPublisher.publish(topic, message);
lastMessagePublished.set(message);