Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libs/SalesforceSDK/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
<string name="oauth_display_type">touch</string>

<!-- Default API version used by the SDK and sample apps -->
<string name="api_version">v63.0</string>
<string name="api_version">v66.0</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
*/
public class ApiVersionStrings {

public static final String VERSION_NUMBER = "v63.0";
public static final String VERSION_NUMBER = "v66.0";

/** A version number override exclusively to support unit tests */
@VisibleForTesting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class NotificationsApiClient(
val apiVersion = ApiVersionStrings.getVersionNumber(context)

// Submit the request.
if (apiVersion < "v64.0") { // TODO: Remove once MSDK default API version is 64 or greater.
if (apiVersion < "v64.0") {
SalesforceSDKLogger.w(TAG, "Cannot request Salesforce push notifications types with API less than v64.0")
return null
}
Expand Down Expand Up @@ -98,7 +98,7 @@ class NotificationsApiClient(
val apiVersion = ApiVersionStrings.getVersionNumber(context)

// Submit the request.
if (apiVersion < "v64.0") { // TODO: Remove once MSDK default API version is 64 or greater.
if (apiVersion < "v64.0") {
SalesforceSDKLogger.w(TAG, "Cannot submit Salesforce Notifications API action with API less than v64.0")
return null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,6 @@
notificationsTypes = fromJson(NOTIFICATIONS_TYPES_JSON)
)

ApiVersionStrings.VERSION_NUMBER_TEST = "v64.0"

// Test once for coverage only with the default REST client.
assertThrows(SSLPeerUnverifiedException::class.java) {
salesforceSdkManager.invokeServerNotificationAction(
Expand Down Expand Up @@ -242,7 +240,7 @@
val restClient = mockk<RestClient>()
every { restClient.sendSync(any()) } returns restResponse

val notificationsActionsResponseBody = salesforceSdkManager.invokeServerNotificationAction(

Check failure on line 243 in libs/test/SalesforceSDKTest/src/com/salesforce/androidsdk/app/PushMessagingTest.kt

View workflow job for this annotation

GitHub Actions / SalesforceSDK Test Results | api_35_test_result.xml

PushMessagingTest.testInvokeServerNotificationActionViaSdkManager_WithoutAccount (failure 1/2)

io.mockk.MockKException: no answer found for RestClient(#21).getClientInfo() among the configured answers: (RestClient(#21).sendSync(any()))) at io.mockk.impl.stub.MockKStub.defaultAnswer(MockKStub.kt:93)
Raw output
io.mockk.MockKException: no answer found for RestClient(#21).getClientInfo() among the configured answers: (RestClient(#21).sendSync(any())))
	at io.mockk.impl.stub.MockKStub.defaultAnswer(MockKStub.kt:93)
	at io.mockk.impl.stub.MockKStub.answer(MockKStub.kt:44)
	at io.mockk.impl.recording.states.AnsweringState.call(AnsweringState.kt:16)
	at io.mockk.impl.recording.CommonCallRecorder.call(CommonCallRecorder.kt:53)
	at io.mockk.impl.stub.MockKStub.handleInvocation(MockKStub.kt:271)
	at io.mockk.impl.instantiation.JvmMockFactoryHelper$mockHandler$1.invocation(JvmMockFactoryHelper.kt:24)
	at io.mockk.proxy.android.advice.Advice.handle$lambda$0(Advice.kt:78)
	at io.mockk.proxy.android.advice.Advice.$r8$lambda$__tUSv4gdDmG-jSc9y9hgANlxW8(Unknown Source:0)
	at io.mockk.proxy.android.advice.Advice$$ExternalSyntheticLambda0.call(D8$$SyntheticClass:0)
	at com.salesforce.androidsdk.rest.RestClient.getClientInfo(Unknown Source:33)
	at com.salesforce.androidsdk.rest.NotificationsApiClient.submitNotificationAction(NotificationsApiClient.kt:108)
	at com.salesforce.androidsdk.app.SalesforceSDKManager.invokeServerNotificationAction(SalesforceSDKManager.kt:679)
	at com.salesforce.androidsdk.app.PushMessagingTest.testInvokeServerNotificationActionViaSdkManager_WithoutAccount(PushMessagingTest.kt:243)

Check failure on line 243 in libs/test/SalesforceSDKTest/src/com/salesforce/androidsdk/app/PushMessagingTest.kt

View workflow job for this annotation

GitHub Actions / SalesforceSDK Test Results | api_35_test_result.xml

PushMessagingTest.testInvokeServerNotificationActionViaSdkManager_WithoutAccount (failure 2/2)

io.mockk.MockKException: no answer found for RestClient(#21).getClientInfo() among the configured answers: (RestClient(#21).sendSync(any()))) at io.mockk.impl.stub.MockKStub.defaultAnswer(MockKStub.kt:93)
Raw output
io.mockk.MockKException: no answer found for RestClient(#21).getClientInfo() among the configured answers: (RestClient(#21).sendSync(any())))
	at io.mockk.impl.stub.MockKStub.defaultAnswer(MockKStub.kt:93)
	at io.mockk.impl.stub.MockKStub.answer(MockKStub.kt:44)
	at io.mockk.impl.recording.states.AnsweringState.call(AnsweringState.kt:16)
	at io.mockk.impl.recording.CommonCallRecorder.call(CommonCallRecorder.kt:53)
	at io.mockk.impl.stub.MockKStub.handleInvocation(MockKStub.kt:271)
	at io.mockk.impl.instantiation.JvmMockFactoryHelper$mockHandler$1.invocation(JvmMockFactoryHelper.kt:24)
	at io.mockk.proxy.android.advice.Advice.handle$lambda$0(Advice.kt:78)
	at io.mockk.proxy.android.advice.Advice.$r8$lambda$__tUSv4gdDmG-jSc9y9hgANlxW8(Unknown Source:0)
	at io.mockk.proxy.android.advice.Advice$$ExternalSyntheticLambda0.call(D8$$SyntheticClass:0)
	at com.salesforce.androidsdk.rest.RestClient.getClientInfo(Unknown Source:33)
	at com.salesforce.androidsdk.rest.NotificationsApiClient.submitNotificationAction(NotificationsApiClient.kt:108)
	at com.salesforce.androidsdk.app.SalesforceSDKManager.invokeServerNotificationAction(SalesforceSDKManager.kt:679)
	at com.salesforce.androidsdk.app.PushMessagingTest.testInvokeServerNotificationActionViaSdkManager_WithoutAccount(PushMessagingTest.kt:243)
notificationId = "test_notification_id",
actionKey = "test_action_key",
restClient = restClient
Expand Down Expand Up @@ -273,6 +271,8 @@
notificationsTypes = fromJson(NOTIFICATIONS_TYPES_JSON)
)

ApiVersionStrings.VERSION_NUMBER_TEST = "v63.0"

val notificationsActionsResponseBody = salesforceSdkManager.invokeServerNotificationAction(
notificationId = "test_notification_id",
actionKey = "test_action_key",
Expand All @@ -299,8 +299,6 @@
notificationsTypes = fromJson(NOTIFICATIONS_TYPES_JSON)
)

ApiVersionStrings.VERSION_NUMBER_TEST = "v64.0"

assertThrows(NotificationsApiException::class.java) {
salesforceSdkManager.invokeServerNotificationAction(
notificationId = "test_notification_id",
Expand Down Expand Up @@ -330,8 +328,6 @@
notificationsTypes = fromJson(NOTIFICATIONS_TYPES_JSON)
)

ApiVersionStrings.VERSION_NUMBER_TEST = "v64.0"

assertThrows(NotificationsApiException::class.java) {
salesforceSdkManager.invokeServerNotificationAction(
notificationId = "test_notification_id",
Expand Down Expand Up @@ -368,9 +364,6 @@
every { restClient.clientInfo } returns clientInfo
every { restClient.sendSync(any()) } returns restResponse

// Setup.
ApiVersionStrings.VERSION_NUMBER_TEST = "v64.0"

assertThrows(NotificationsApiException::class.java) {
salesforceSdkManager.invokeServerNotificationAction(
notificationId = "test_notification_id",
Expand All @@ -396,9 +389,6 @@
every { restClient.clientInfo } returns clientInfo
every { restClient.sendSync(any()) } returns restResponse

// Setup.
ApiVersionStrings.VERSION_NUMBER_TEST = "v64.0"

assertThrows(NotificationsApiException::class.java) {
salesforceSdkManager.invokeServerNotificationAction(
notificationId = "test_notification_id",
Expand Down Expand Up @@ -431,9 +421,6 @@
every { restClient.clientInfo } returns clientInfo
every { restClient.sendSync(any()) } returns restResponse

// Setup.
ApiVersionStrings.VERSION_NUMBER_TEST = "v64.0"

assertThrows(NotificationsApiException::class.java) {
salesforceSdkManager.invokeServerNotificationAction(
notificationId = "test_notification_id",
Expand Down
Loading