This repository has been archived by the owner on Oct 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PMA-8087 - Add test mode that fakes HTTP calls to the Everlytic API
- Loading branch information
1 parent
1f986d2
commit 4c537ba
Showing
19 changed files
with
223 additions
and
42 deletions.
There are no files selected for viewing
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
28 changes: 28 additions & 0 deletions
28
...cationsdk/src/main/java/com/everlytic/android/pushnotificationsdk/Testing_ApiResponses.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,28 @@ | ||
package com.everlytic.android.pushnotificationsdk | ||
|
||
import com.everlytic.android.pushnotificationsdk.models.ApiResponse | ||
import com.everlytic.android.pushnotificationsdk.models.ApiSubscription | ||
import com.everlytic.android.pushnotificationsdk.models.jsonadapters.JSONAdapter | ||
import org.json.JSONObject | ||
import java.security.SecureRandom | ||
|
||
object Testing_ApiResponses { | ||
|
||
private fun randId() = SecureRandom().nextInt(10000).toString() | ||
|
||
fun subscribeSuccess(deviceId: String) : ApiResponse { | ||
val sub = ApiSubscription( | ||
randId(), | ||
randId(), | ||
randId(), | ||
randId(), | ||
deviceId | ||
) | ||
return ApiResponse("success", JSONAdapter.encode(sub)) | ||
} | ||
|
||
fun unsubscribeSuccess() : ApiResponse { | ||
return ApiResponse("success", JSONObject()) | ||
} | ||
|
||
} |
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
Oops, something went wrong.