-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Partial updates for membership information (#267)
- Loading branch information
1 parent
f5d37b8
commit 6919320
Showing
18 changed files
with
143 additions
and
49 deletions.
There are no files selected for viewing
7 changes: 4 additions & 3 deletions
7
...-core-impl/src/main/kotlin/com/pubnub/internal/models/consumer/objects/member/PNMember.kt
This file contains 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
5 changes: 3 additions & 2 deletions
5
...main/kotlin/com/pubnub/internal/models/consumer/objects/membership/PNChannelMembership.kt
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
39 changes: 39 additions & 0 deletions
39
...nTest/kotlin/com/pubnub/api/models/consumer/objects/membership/PNChannelMembershipTest.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.pubnub.api.models.consumer.objects.membership | ||
|
||
import com.pubnub.api.models.consumer.objects.channel.PNChannelMetadata | ||
import com.pubnub.api.models.consumer.pubsub.objects.PNSetMembershipEvent | ||
import com.pubnub.api.utils.PatchValue | ||
import com.pubnub.test.randomString | ||
import kotlin.test.Test | ||
import kotlin.test.assertEquals | ||
|
||
class PNChannelMembershipTest { | ||
@Test | ||
fun plus() { | ||
val originalMembership = PNChannelMembership( | ||
PNChannelMetadata(randomString()), | ||
custom = PatchValue.of(mapOf(randomString() to randomString())), | ||
updated = randomString(), | ||
eTag = randomString(), | ||
status = null | ||
) | ||
|
||
val updateMembership = PNSetMembershipEvent( | ||
originalMembership.channel.id, | ||
randomString(), | ||
custom = null, | ||
updated = randomString(), | ||
eTag = randomString(), | ||
status = PatchValue.of(randomString()) | ||
) | ||
val expectedMembership = originalMembership.copy( | ||
updated = updateMembership.updated, | ||
eTag = updateMembership.eTag, | ||
status = updateMembership.status | ||
) | ||
|
||
val actualMembership = originalMembership + updateMembership | ||
|
||
assertEquals(expectedMembership, actualMembership) | ||
} | ||
} |
This file contains 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
This file contains 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
Oops, something went wrong.