This is an automated email from the ASF dual-hosted git repository.

brusdev 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 5ce7e897b3 ARTEMIS-5684 all AddressSettings fields should default to 
null
5ce7e897b3 is described below

commit 5ce7e897b3babadde6b73a09c9cf9df9044e5038
Author: Justin Bertram <[email protected]>
AuthorDate: Fri Nov 7 16:48:45 2025 -0600

    ARTEMIS-5684 all AddressSettings fields should default to null
---
 .../artemis/core/settings/impl/AddressSettings.java        |  4 ++--
 .../artemis/core/settings/AddressSettingsTest.java         | 14 ++++++++++----
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/AddressSettings.java
 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/AddressSettings.java
index 2e7c549136..36d2295998 100644
--- 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/AddressSettings.java
+++ 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/settings/impl/AddressSettings.java
@@ -331,7 +331,7 @@ public class AddressSettings implements 
Mergeable<AddressSettings>, Serializable
    static {
       metaBean.add(SlowConsumerThresholdMeasurementUnit.class, 
"slowConsumerThresholdMeasurementUnit", (t, p) -> 
t.slowConsumerThresholdMeasurementUnit = p, t -> 
t.slowConsumerThresholdMeasurementUnit);
    }
-   private SlowConsumerThresholdMeasurementUnit 
slowConsumerThresholdMeasurementUnit = 
DEFAULT_SLOW_CONSUMER_THRESHOLD_MEASUREMENT_UNIT;
+   private SlowConsumerThresholdMeasurementUnit 
slowConsumerThresholdMeasurementUnit = null;
 
    static {
       metaBean.add(Long.class, "slowConsumerCheckPeriod", (t, p) -> 
t.slowConsumerCheckPeriod = p, t -> t.slowConsumerCheckPeriod);
@@ -445,7 +445,7 @@ public class AddressSettings implements 
Mergeable<AddressSettings>, Serializable
    static {
       metaBean.add(Integer.class, "managementBrowsePageSize", (t, p) -> 
t.managementBrowsePageSize = p, t -> t.managementBrowsePageSize);
    }
-   private Integer managementBrowsePageSize = 
AddressSettings.MANAGEMENT_BROWSE_PAGE_SIZE;
+   private Integer managementBrowsePageSize = null;
 
    static {
       metaBean.add(Long.class, "maxSizeBytesRejectThreshold", (t, p) -> 
t.maxSizeBytesRejectThreshold = p, t -> t.maxSizeBytesRejectThreshold);
diff --git 
a/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/AddressSettingsTest.java
 
b/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/AddressSettingsTest.java
index 21fdfd2c0c..5b74ba0892 100644
--- 
a/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/AddressSettingsTest.java
+++ 
b/artemis-server/src/test/java/org/apache/activemq/artemis/core/settings/AddressSettingsTest.java
@@ -16,10 +16,7 @@
  */
 package org.apache.activemq.artemis.core.settings;
 
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNull;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-
+import java.io.StringReader;
 import java.lang.invoke.MethodHandles;
 
 import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
@@ -28,10 +25,15 @@ import 
org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.core.settings.impl.DeletionPolicy;
 import org.apache.activemq.artemis.tests.util.ServerTestBase;
+import org.apache.activemq.artemis.utils.JsonLoader;
 import org.junit.jupiter.api.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
 public class AddressSettingsTest extends ServerTestBase {
 
    private static final Logger logger = 
LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
@@ -261,6 +263,10 @@ public class AddressSettingsTest extends ServerTestBase {
       assertEquals(addressSettings.getAddressFullMessagePolicy(), 
jsonClone.getAddressFullMessagePolicy());
 
       assertEquals(addressSettings, jsonClone);
+   }
 
+   @Test
+   public void testToJSONEmpty() {
+      assertEquals(0, JsonLoader.readObject(new StringReader(new 
AddressSettings().toJSON())).size());
    }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to