-
-
Save sukyology/071192f1d141d8d04213a095002d63a4 to your computer and use it in GitHub Desktop.
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
class FieldExists { | |
@JvmField | |
var field: String = "Hello" | |
} | |
class ExampleTest { | |
@Test | |
fun `field exists class mocking`() { | |
val fieldExists = mockk<FieldExists>() | |
assertEquals("Hello", fieldExists.field) | |
// java.lang.AssertionError: | |
// Expected :Hello | |
// Actual :null | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment