https://kotlinlang.org logo
#kotest
Title
# kotest
k

klimchuk daniil

03/05/2024, 6:54 PM
Hello everyone! I'm writing a simple test with null parameters, but mockk can't seem to understand that and i get the following exception:
Copy code
no answer found for EncryptedSharedPreferencesStorage(#10).set(ACCESS_TOKEN_KEY, null) among the configured answers: (EncryptedSharedPreferencesStorage(#10).set(eq(ACCESS_TOKEN_KEY), null()))
This clearly shows that i'm mocking the method with the called parameters, because they both match The test code is:
Copy code
every { prefs.set(ACCESS_TOKEN_KEY, isNull()) } just runs
storage.clear()
verify { prefs.set(ACCESS_TOKEN_KEY, null) }
What am i doing wrong?