When attempting to create an instance of a Kotlin class containing a Java reference type class property using giveMeOne(), the creation fails because fixture monkey attempts to handle the Java class as Kotlin class.
Your environment
version of Fixture Monkey : 1.0.14
*Kotlin kotlin 1.9.22
Steps to reproduce
val sut: FixtureMonkey = FixtureMonkey.builder()
.plugin(KotlinPlugin())
.build()
// when
class KotlinObjectWithJavaObject(val javaObject: JavaObject)
val actual = sut.giveMeOne<KotlinObjectWithJavaObject>()
then(actual).isNotNull
then(actual.javaObject).isNotNull
then(actual.javaObject.value).isNotNull
Expected behaviour
Properties of a Kotlin class, regardless of whether they are Java or Kotlin classes, should be instantiated and initialized correctly.
Describe the bug
When attempting to create an instance of a Kotlin class containing a Java reference type class property using giveMeOne(), the creation fails because fixture monkey attempts to handle the Java class as Kotlin class.
Your environment
Steps to reproduce
Expected behaviour
Properties of a Kotlin class, regardless of whether they are Java or Kotlin classes, should be instantiated and initialized correctly.
Actual behaviour