diff --git a/pubnub-chat-api/pubnub_chat_api.podspec b/pubnub-chat-api/pubnub_chat_api.podspec index 2d1f2c55..4b4b951a 100644 --- a/pubnub-chat-api/pubnub_chat_api.podspec +++ b/pubnub-chat-api/pubnub_chat_api.podspec @@ -9,7 +9,7 @@ Pod::Spec.new do |spec| spec.vendored_frameworks = 'build/cocoapods/framework/pubnub_chat_api.framework' spec.libraries = 'c++' spec.ios.deployment_target = '14' - spec.dependency 'PubNubSwift', '8.0.0' + spec.dependency 'PubNubSwift', '8.0.1' if !Dir.exist?('build/cocoapods/framework/pubnub_chat_api.framework') || Dir.empty?('build/cocoapods/framework/pubnub_chat_api.framework') raise " diff --git a/pubnub-chat-impl/pubnub_chat_impl.podspec b/pubnub-chat-impl/pubnub_chat_impl.podspec index 660c6a17..37138142 100644 --- a/pubnub-chat-impl/pubnub_chat_impl.podspec +++ b/pubnub-chat-impl/pubnub_chat_impl.podspec @@ -9,7 +9,7 @@ Pod::Spec.new do |spec| spec.vendored_frameworks = 'build/cocoapods/framework/pubnub_chat_impl.framework' spec.libraries = 'c++' spec.ios.deployment_target = '14' - spec.dependency 'PubNubSwift', '8.0.0' + spec.dependency 'PubNubSwift', '8.0.1' if !Dir.exist?('build/cocoapods/framework/pubnub_chat_impl.framework') || Dir.empty?('build/cocoapods/framework/pubnub_chat_impl.framework') raise " diff --git a/pubnub-chat-impl/src/commonTest/kotlin/com/pubnub/integration/AccessManagerTest.kt b/pubnub-chat-impl/src/commonTest/kotlin/com/pubnub/integration/AccessManagerTest.kt index 5bcbafc9..f6b5224a 100644 --- a/pubnub-chat-impl/src/commonTest/kotlin/com/pubnub/integration/AccessManagerTest.kt +++ b/pubnub-chat-impl/src/commonTest/kotlin/com/pubnub/integration/AccessManagerTest.kt @@ -1,9 +1,8 @@ package com.pubnub.integration +import com.pubnub.api.PubNubException import com.pubnub.api.models.consumer.access_manager.v3.ChannelGrant import com.pubnub.api.models.consumer.access_manager.v3.UUIDGrant -import com.pubnub.api.v2.callbacks.Result -import com.pubnub.chat.Channel import com.pubnub.chat.Event import com.pubnub.chat.internal.message.MessageImpl import com.pubnub.chat.listenForEvents @@ -12,22 +11,16 @@ import com.pubnub.test.await import kotlinx.coroutines.test.runTest import kotlin.test.Test import kotlin.test.assertEquals +import kotlin.test.assertFailsWith class AccessManagerTest : BaseChatIntegrationTest() { @Test fun pubNubClient_with_PAM_enabled_should_not_getChannel_when_no_token_set() = runTest { val channelId = channelPam.id - var statusCode = 0 val expectedStatusCode = 403 // Forbidden, no valid security Token provided - chatPamClient.getChannel(channelId).async { result: Result -> - result.onFailure { e -> - statusCode = e.statusCode - }.onSuccess { channel: Channel? -> - throw IllegalStateException("Should not enter here. Should return exception.") - } - } - delayInMillis(1000) - assertEquals(expectedStatusCode, statusCode) + + val exception = assertFailsWith { chatPamClient.getChannel(channelId).await() } + assertEquals(expectedStatusCode, exception.statusCode) } @Test @@ -42,17 +35,9 @@ class AccessManagerTest : BaseChatIntegrationTest() { // client uses token generated by server chatPamClient.pubNub.setToken(token) - var actualChannelId: String? = "" val token1 = chatPamClient.pubNub.getToken() assertEquals(token1, token) - chatPamClient.getChannel(channelId).async { result: Result -> - result.onFailure { - throw IllegalStateException("Should not enter here. Should return channel.") - }.onSuccess { channel: Channel? -> - actualChannelId = channel?.id - } - } - delayInMillis(1000) + val actualChannelId = chatPamClient.getChannel(channelId).await()?.id assertEquals(channelId, actualChannelId) chatPamServer.deleteChannel(id = channelId).await() diff --git a/pubnub_chat.podspec b/pubnub_chat.podspec index d6ae55af..fe6f6aca 100644 --- a/pubnub_chat.podspec +++ b/pubnub_chat.podspec @@ -9,7 +9,7 @@ Pod::Spec.new do |spec| spec.vendored_frameworks = 'build/cocoapods/framework/PubNubChat.framework' spec.libraries = 'c++' spec.ios.deployment_target = '14' - spec.dependency 'PubNubSwift', '8.0.0' + spec.dependency 'PubNubSwift', '8.0.1' if !Dir.exist?('build/cocoapods/framework/PubNubChat.framework') || Dir.empty?('build/cocoapods/framework/PubNubChat.framework') raise "