Skip to content

Conversation

@marcin-cebo
Copy link
Contributor

just emit SubscriptionChanged status.

}

@Test
fun whenSubscribingToAlreadySubscribedChannelShouldNotResubscribeButShouldEmitSubscriptionChangedStatus() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a pretty long name. What about shouldEmitSubscriptionChangedWhenAlreadySubscribed or something similar?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldEmitSubscriptionChangedWhenAlreadySubscribed misses important part that we want to make sure that there is no resubscribe.
Name is pretty long but I think it serve the purpose of properly describing what the test does.
The test is complex and IMHO it is good that name describe its behaviour.

What do you think?

@Test
fun can_transit_from_RECEIVING_to_RECEIVING_when_there_is_SUBSCRIPTION_CHANGED_event() {
fun can_transit_from_RECEIVING_to_RECEIVING_when_there_is_SUBSCRIPTION_CHANGED_event_with_different_channels_and_groups() {
// given
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’d avoid adding comments like // given, // when, or // then. Instead, add comments only when they clarify something that is not obvious

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// given, // when, // then is convention that exist in many test in this SDK.
I would leave them for now.
Personally I find // given, // when, // then useful when reading tests.

@marcin-cebo marcin-cebo force-pushed the mc/subscribeToTheSameChanel_noResubscribe branch from 68be032 to d377ea8 Compare November 20, 2025 12:32
@jguz-pubnub jguz-pubnub self-requested a review November 20, 2025 16:06
@marcin-cebo marcin-cebo merged commit bdcdeb1 into master Nov 25, 2025
7 checks passed
@marcin-cebo marcin-cebo deleted the mc/subscribeToTheSameChanel_noResubscribe branch November 25, 2025 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants