Replaces EncryptedPrefsFormatTest assertThrows with assertFailsWith
Related to #2745
This commit is contained in:
parent
c96acfe1b1
commit
80011759f5
1 changed files with 3 additions and 2 deletions
|
@ -17,6 +17,7 @@ import org.mockito.ArgumentMatchers
|
||||||
import org.mockito.Mock
|
import org.mockito.Mock
|
||||||
import org.mockito.Mockito
|
import org.mockito.Mockito
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
import kotlin.test.assertFailsWith
|
||||||
|
|
||||||
// https://stackoverflow.com/questions/52344522/joseexception-couldnt-create-aes-gcm-nopadding-cipher-illegal-key-size
|
// https://stackoverflow.com/questions/52344522/joseexception-couldnt-create-aes-gcm-nopadding-cipher-illegal-key-size
|
||||||
// https://stackoverflow.com/questions/47708951/can-aes-256-work-on-android-devices-with-api-level-26
|
// https://stackoverflow.com/questions/47708951/can-aes-256-work-on-android-devices-with-api-level-26
|
||||||
|
@ -208,7 +209,7 @@ open class EncryptedPrefsFormatTest : TestBase() {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun garbageInputTest() {
|
fun garbageInputTest() {
|
||||||
Assertions.assertThrows(PrefFormatError::class.java) {
|
assertFailsWith<PrefFormatError> {
|
||||||
val frozenPrefs = "whatever man, i duno care"
|
val frozenPrefs = "whatever man, i duno care"
|
||||||
|
|
||||||
val storage = SingleStringStorage(frozenPrefs)
|
val storage = SingleStringStorage(frozenPrefs)
|
||||||
|
@ -219,7 +220,7 @@ open class EncryptedPrefsFormatTest : TestBase() {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun unknownFormatTest() {
|
fun unknownFormatTest() {
|
||||||
Assertions.assertThrows(PrefFormatError::class.java) {
|
assertFailsWith<PrefFormatError> {
|
||||||
val frozenPrefs = "{\n" +
|
val frozenPrefs = "{\n" +
|
||||||
" \"metadata\": {},\n" +
|
" \"metadata\": {},\n" +
|
||||||
" \"security\": {\n" +
|
" \"security\": {\n" +
|
||||||
|
|
Loading…
Reference in a new issue