Repository navigation
Conversation
yuluo-yx
force-pushed
the
fix/pr-8087-mqtt-test-fixtures
branch
from
October 24, 2026 10:08
4ecded4 to
492c0b8
Compare
Aias00
previously approved these changes
Oct 24, 2026
yuluo-yx
pushed a commit
that referenced
this pull request
Oct 24, 2026
…ion update (#8093) SubscribeTest mocked ChannelRepository and SessionRepository, and a mock answers null for every lookup. subscribe() therefore always took the "no session" branch: the client id was null, the session was null, and the code that stores the granted subscriptions on the session never ran. The three assertions only covered SUBACK, so a regression there would have gone unnoticed. The channel and session repositories are now real instances, the connected channel is registered in the channel repository, and a fourth test asserts that the subscriptions land on the session. SubscribeRepository and TopicRepository stay mocked, because subscribe() writes to the first and the second is only observed through verify(). This also supersedes #8089, which adds the same real instances but keeps the @mock fields with the same names and does not compile. Co-authored-by: cloudbase-ai <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SubscribeTestMqttTransportHandlerTestNullPointerExceptionfailures in CIValidation
./mvnw test -pl shenyu-protocol/shenyu-protocol-mqtt -Drat.skip=true -Djacoco.skip=true./mvnw test -pl shenyu-common -DskipITsgit diff --checkpassed