Closed kdohyeon closed 8 months ago
@kdohyeon
Hello. Currently, object
inheriting a sealed class is not supported, as it is a constant that does not need to populate random properties.
There is an alternative way to generate it.
FixtureMonkey.builder()
.plugin(KotlinPlugin())
.pushAssignableTypeObjectPropertyGenerator<SealedClassA> { context ->
InterfaceObjectPropertyGenerator(listOf(SealedClassA.OBJECTA::class.java))
.generate(context)
}
.pushAssignableTypeArbitraryIntrospector<SealedClassA> {
ArbitraryIntrospectorResult(
CombinableArbitrary.from(SealedClassA.OBJECTA),
)
}
.build()
It will be supported in version 1.1.0.
Thank you.
Oh, thank you for the guide code.
It works well. 👍
Describe your question
Tell us what kind of problem you are having.
I am having difficulty applying FixtureMonkey with Kotlin's sealed class and object.
Please consider the below code:
Did I miss out some configs? Anybody faced some similuar issue like this?
Any kind of help would be really appreciated.
Thank you!