Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When attempting to create an instance of a Kotlin class containing a Java reference type class property, the creation fails #946

Open
jinia91 opened this issue Mar 13, 2024 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@jinia91
Copy link
Contributor

jinia91 commented Mar 13, 2024

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

  • 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.

Actual behaviour

image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants