-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: duplicate test in android and jvm
- Loading branch information
1 parent
8670448
commit a31b16d
Showing
3 changed files
with
40 additions
and
60 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
src/androidInstrumentedTest/kotlin/software/momento/kotlin/sdk/LimitExceededExceptionTest.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,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")) | ||
} | ||
} |
60 changes: 0 additions & 60 deletions
60
src/commonTest/kotlin/software/momento/kotlin/sdk/exceptions/LimitExceededExceptionTest.kt
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
src/jvmTest/kotlin/software/momento/kotlin/sdk/LimitExceededExceptionTest.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,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")) | ||
} | ||
} |