Hi Jean-Louis,

It looks like this test passed "by chance" in the past and is not fully
correct.

Let me take a deeper look (as soon as my connection is stable again due to
the storm ;)).

Regards
JB

On Thu, Jan 8, 2026 at 7:32 PM Jean-Louis Monteiro <[email protected]>
wrote:

> Hi,
>
> First of all, happy new year!
>
> I am back on Java 25, and I've been facing an issue
> with MQTTProtocolConverterTest.
> The issue is mostly related to the assertion
>
>
> https://github.com/apache/activemq/blob/main/activemq-mqtt/src/test/java/org/apache/activemq/transport/mqtt/MQTTProtocolConverterTest.java#L132
>
> > Mockito.verify(transport, times(4)).sendToActiveMQ(removeInfo.capture());
>
> The problem when running on Java 25, is that the assert fails because we
> always get 1 and not 4 invocations. Not sure why it fails consistently on
> Java 25 to be honest. The question is why it ever worked.
>
> The test was introduced with
>
> https://github.com/apache/activemq/commit/6d4459a00c2441822297b06221bb107c5843c390
> which was meant to make sure only one call could be issued to the
> transport. I don't understand why 4 was used in the first place.
>
> My assumption is that with Java 25, I updated Mockito (ByteBuddy needs to
> work on Java 25), and the new version now really returns now the right
> value for
>
> > Mockito.verify(transport, times(4)).sendToActiveMQ(removeInfo.capture());
>
> Previously, RemoveInfo.capture() was not being honored I think, so we were
> also counting calls with ConnectionInfo, SessionInfo, etc.
>
> But to me, the actual value should be 1.
>
> Now, I created an issue https://issues.apache.org/jira/browse/AMQ-9826
> I created a PR https://github.com/apache/activemq/pull/1571
> But the CI fails on this test
>
> https://ci-builds.apache.org/job/ActiveMQ/job/ActiveMQ/view/change-requests/job/PR-1571/
>
> thoughts?
> I'm planning to do the Mockito upgrade as part of this PR (instead of Java
> 25), to see if this test can succeed against main.
>
> --
> Jean-Louis Monteiro
> http://twitter.com/jlouismonteiro
> http://www.tomitribe.com
>

Reply via email to