#2404 - Initializing @OneToMany with mutableListOf() in Kotlin results in ClassCastException

This commit is contained in:
Rob Bygrave committed 2021-10-05 10:17:44 +13:00
1 parent 2cee03bc4b
commit 40492f487c
4 files changed
+57 -9

No files matched your search

@@ -0,0 +1,18 @@
package io.ebean.test.kotlin
import io.ebean.common.BeanList
import org.assertj.core.api.Assertions.assertThat
import org.example.order.Customer
import org.example.order.Order
import org.junit.jupiter.api.Test
class OneToManyEnhancementTest {
@Test
fun `o2m is BeanCollection`() {
val customer = Customer("foo")
val order = Order(customer)
assertThat(order.items).isInstanceOf(BeanList::class.java)
}
}