Android Test In Kotlin Of Realm
How can be done a simple test of a realm database in Android implementing the test in Kotlin? I attempted to adapt a fragment from java realm test on github to kotlin and got the n
Solution 1:
You can make the getter of the rule public like so:
@get: Rule
var rule = PowerMockRule()
Or you can mark it as a Java style field with the @JvmField
annotation:
@JvmField@Rule
var rule = PowerMockRule()
You can find more details in this answer: https://stackoverflow.com/a/32827600/4465208
Ps. You should also consider making it a val
if you don't intend on changing its value anywhere.
Solution 2:
Realm java 4.1.0 has been released and most problem of Realm with Kotlin has resolved! . You can test my sample project to see how you must config project or create classes. My sample is for testing module in Realm object Server with kotlin.
Post a Comment for "Android Test In Kotlin Of Realm"