diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/MetricsPluginTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/MetricsPluginTest.java index 26fbd2ba98..5ea14861f0 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/MetricsPluginTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/plugin/MetricsPluginTest.java @@ -37,6 +37,7 @@ import org.apache.activemq.artemis.api.core.client.ClientSession; import org.apache.activemq.artemis.api.core.client.ClientSessionFactory; import org.apache.activemq.artemis.api.core.client.ServerLocator; import org.apache.activemq.artemis.core.server.ActiveMQServer; +import org.apache.activemq.artemis.core.server.Queue; import org.apache.activemq.artemis.core.server.metrics.plugins.SimpleMetricsPlugin; import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy; import org.apache.activemq.artemis.tests.util.Wait; @@ -159,6 +160,9 @@ public class MetricsPluginTest extends ActiveMQTestBase { producer.send(message); producer.close(); + Queue queue = server.locateQueue(queueName); + Wait.assertEquals(1, queue::getMessageCount); + Map metrics = getMetrics(); checkMetric(metrics, "artemis.message.count", "queue", queueName, 1.0);