[
https://issues.apache.org/jira/browse/ARTEMIS-5142?focusedWorklogId=945528&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-945528
]
ASF GitHub Bot logged work on ARTEMIS-5142:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 25/Nov/24 17:46
Start Date: 25/Nov/24 17:46
Worklog Time Spent: 10m
Work Description: jbertram commented on code in PR #5334:
URL: https://github.com/apache/activemq-artemis/pull/5334#discussion_r1857061404
##########
artemis-server/src/test/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImplTest.java:
##########
@@ -0,0 +1,252 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.artemis.core.postoffice.impl;
+
+import org.apache.activemq.artemis.api.core.Message;
+import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
+import org.junit.jupiter.api.Test;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Mockito;
+
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+public class PostOfficeImplTest {
+
+ private static final int EXPIRATION_DELTA = 5000;
+
+ @Test
+ public void testZeroMaxExpiryDelayWhenExpirationNotSet() {
+ Message mockMessage = Mockito.mock(Message.class);
+ Mockito.when(mockMessage.getExpiration()).thenReturn(0L);
+ PostOfficeImpl.applyExpiryDelay(mockMessage, new
AddressSettings().setMaxExpiryDelay(0L));
+ Mockito.verify(mockMessage).setExpiration(Mockito.anyLong());
Review Comment:
Fixed.
Issue Time Tracking
-------------------
Worklog Id: (was: 945528)
Time Spent: 4h 20m (was: 4h 10m)
> Setting 0 for min/max expiry-delivery not working as expected
> -------------------------------------------------------------
>
> Key: ARTEMIS-5142
> URL: https://issues.apache.org/jira/browse/ARTEMIS-5142
> Project: ActiveMQ Artemis
> Issue Type: Improvement
> Reporter: Justin Bertram
> Assignee: Justin Bertram
> Priority: Major
> Labels: pull-request-available
> Time Spent: 4h 20m
> Remaining Estimate: 0h
>
> If {{max-expiry-delay}} or {{min-expiry-delay}} is set to {{0}} messages are
> expired _immediately_ rather than not expired at all as expected.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact