Skip to content

Commit a4dba19

Browse files
committed
Update push tests for REST API version change
1 parent 760e588 commit a4dba19

2 files changed

Lines changed: 4 additions & 17 deletions

File tree

libs/SalesforceSDK/src/com/salesforce/androidsdk/rest/NotificationsApiClient.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class NotificationsApiClient(
5959
val apiVersion = ApiVersionStrings.getVersionNumber(context)
6060

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

100100
// Submit the request.
101-
if (apiVersion < "v64.0") { // TODO: Remove once MSDK default API version is 64 or greater.
101+
if (apiVersion < "v64.0") {
102102
SalesforceSDKLogger.w(TAG, "Cannot submit Salesforce Notifications API action with API less than v64.0")
103103
return null
104104
}

libs/test/SalesforceSDKTest/src/com/salesforce/androidsdk/app/PushMessagingTest.kt

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,6 @@ class PushMessagingTest {
208208
notificationsTypes = fromJson(NOTIFICATIONS_TYPES_JSON)
209209
)
210210

211-
ApiVersionStrings.VERSION_NUMBER_TEST = "v64.0"
212-
213211
// Test once for coverage only with the default REST client.
214212
assertThrows(SSLPeerUnverifiedException::class.java) {
215213
salesforceSdkManager.invokeServerNotificationAction(
@@ -273,6 +271,8 @@ class PushMessagingTest {
273271
notificationsTypes = fromJson(NOTIFICATIONS_TYPES_JSON)
274272
)
275273

274+
ApiVersionStrings.VERSION_NUMBER_TEST = "v63.0"
275+
276276
val notificationsActionsResponseBody = salesforceSdkManager.invokeServerNotificationAction(
277277
notificationId = "test_notification_id",
278278
actionKey = "test_action_key",
@@ -299,8 +299,6 @@ class PushMessagingTest {
299299
notificationsTypes = fromJson(NOTIFICATIONS_TYPES_JSON)
300300
)
301301

302-
ApiVersionStrings.VERSION_NUMBER_TEST = "v64.0"
303-
304302
assertThrows(NotificationsApiException::class.java) {
305303
salesforceSdkManager.invokeServerNotificationAction(
306304
notificationId = "test_notification_id",
@@ -330,8 +328,6 @@ class PushMessagingTest {
330328
notificationsTypes = fromJson(NOTIFICATIONS_TYPES_JSON)
331329
)
332330

333-
ApiVersionStrings.VERSION_NUMBER_TEST = "v64.0"
334-
335331
assertThrows(NotificationsApiException::class.java) {
336332
salesforceSdkManager.invokeServerNotificationAction(
337333
notificationId = "test_notification_id",
@@ -368,9 +364,6 @@ class PushMessagingTest {
368364
every { restClient.clientInfo } returns clientInfo
369365
every { restClient.sendSync(any()) } returns restResponse
370366

371-
// Setup.
372-
ApiVersionStrings.VERSION_NUMBER_TEST = "v64.0"
373-
374367
assertThrows(NotificationsApiException::class.java) {
375368
salesforceSdkManager.invokeServerNotificationAction(
376369
notificationId = "test_notification_id",
@@ -396,9 +389,6 @@ class PushMessagingTest {
396389
every { restClient.clientInfo } returns clientInfo
397390
every { restClient.sendSync(any()) } returns restResponse
398391

399-
// Setup.
400-
ApiVersionStrings.VERSION_NUMBER_TEST = "v64.0"
401-
402392
assertThrows(NotificationsApiException::class.java) {
403393
salesforceSdkManager.invokeServerNotificationAction(
404394
notificationId = "test_notification_id",
@@ -431,9 +421,6 @@ class PushMessagingTest {
431421
every { restClient.clientInfo } returns clientInfo
432422
every { restClient.sendSync(any()) } returns restResponse
433423

434-
// Setup.
435-
ApiVersionStrings.VERSION_NUMBER_TEST = "v64.0"
436-
437424
assertThrows(NotificationsApiException::class.java) {
438425
salesforceSdkManager.invokeServerNotificationAction(
439426
notificationId = "test_notification_id",

0 commit comments

Comments
 (0)