Skip to content

Commit

Permalink
chore: duplicate test in android and jvm
Browse files Browse the repository at this point in the history
  • Loading branch information
rishtigupta committed Nov 12, 2024
1 parent 8670448 commit a31b16d
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 60 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package software.momento.kotlin.sdk


import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import kotlinx.coroutines.test.runTest
import org.junit.Test
import org.junit.runner.RunWith

@RunWith(AndroidJUnit4::class)
@LargeTest
class LimitExceededExceptionTest: BaseAndroidTestClass() {

@Test
fun shouldFailWithResourceExhaustedMessage() = runTest {
val key = "cache";
val value = 'x'.toString().repeat(5_300_000) // 5.3MB

val setResponse = cacheClient.set(cacheName, key, value)
val stringifiedResponse = setResponse.toString()
assert(stringifiedResponse.contains("Request size limit exceeded for this account"))
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package software.momento.kotlin.sdk

import kotlinx.coroutines.test.runTest
import kotlin.test.Test

class LimitExceededExceptionTest: BaseJvmTestClass() {

@Test
fun shouldFailWithResourceExhaustedMessage() = runTest {
val key = "cache";
val value = 'x'.toString().repeat(5_300_000) // 5.3MB

val setResponse = cacheClient.set(cacheName, key, value)
val stringifiedResponse = setResponse.toString()
assert(stringifiedResponse.contains("Request size limit exceeded for this account"))
}
}

0 comments on commit a31b16d

Please sign in to comment.