summaryrefslogtreecommitdiffhomepage
path: root/android/test
diff options
context:
space:
mode:
authorAlbin <albin@mullvad.net>2025-01-23 22:53:31 +0100
committerAlbin <albin@mullvad.net>2025-01-27 15:58:46 +0100
commit2f615a48d78650a25a86bee6e50a945266dad3a0 (patch)
tree8624561ae796957501f3aa06523bf59642490059 /android/test
parenta928adaf65c71c11c8b9c7752dd16a74f98d2154 (diff)
downloadmullvadvpn-2f615a48d78650a25a86bee6e50a945266dad3a0.tar.xz
mullvadvpn-2f615a48d78650a25a86bee6e50a945266dad3a0.zip
Improve e2e test api client error handling
Co-authored-by: Niklas Berglund <niklas.berglund@gmail.com>
Diffstat (limited to 'android/test')
-rw-r--r--android/test/e2e/src/main/kotlin/net/mullvad/mullvadvpn/test/e2e/misc/SimpleMullvadHttpClient.kt5
1 files changed, 5 insertions, 0 deletions
diff --git a/android/test/e2e/src/main/kotlin/net/mullvad/mullvadvpn/test/e2e/misc/SimpleMullvadHttpClient.kt b/android/test/e2e/src/main/kotlin/net/mullvad/mullvadvpn/test/e2e/misc/SimpleMullvadHttpClient.kt
index b5dcc1d647..c8ccc60ddb 100644
--- a/android/test/e2e/src/main/kotlin/net/mullvad/mullvadvpn/test/e2e/misc/SimpleMullvadHttpClient.kt
+++ b/android/test/e2e/src/main/kotlin/net/mullvad/mullvadvpn/test/e2e/misc/SimpleMullvadHttpClient.kt
@@ -17,6 +17,7 @@ import net.mullvad.mullvadvpn.test.e2e.constant.DEVICE_LIST_URL
import net.mullvad.mullvadvpn.test.e2e.constant.PARTNER_ACCOUNT_URL
import org.json.JSONArray
import org.json.JSONObject
+import org.junit.jupiter.api.fail
class SimpleMullvadHttpClient(context: Context) {
@@ -201,6 +202,10 @@ class SimpleMullvadHttpClient(context: Context) {
private val onErrorResponse = { error: VolleyError ->
if (error.networkResponse != null) {
+ if (error.networkResponse.statusCode == 429) {
+ fail("Request failed with response status code 429: Too many requests")
+ }
+
Logger.e(
"Response returned error message: ${error.message} " +
"status code: ${error.networkResponse.statusCode}"