Disclaimer: Not sure if this is a bug - or if it's in JavaFixture or Kotlin fixture for that matter.
@Test
fun withType() {
val sut = SpecimenBuilder(com.github.nylle.javafixture.SpecimenBuilder(object : SpecimenType<TestObjectGeneric<String, List<Int>>>(){}, configure()))
val result = sut
.with<Int>(111111)
.create()
assertThat(result).isInstanceOf(TestObjectGeneric::class.java)
assertThat(result.u).contains(111111)
}
java.lang.AssertionError:
Expecting:
<[229551647, -2024430022, -2056851173, 462021988, -1922426415]>
to contain:
<[111111]>
but could not find:
<[111111]>
Something that indicates that this is a problem with containers (lists in this case) is that this test case works perfectly fine:
@Test
fun withType() {
val sut = SpecimenBuilder(com.github.nylle.javafixture.SpecimenBuilder(object : SpecimenType<TestObjectGeneric<String, Int>>(){}, configure()))
val result = sut
.with<Int>(111111)
.create()
assertThat(result).isInstanceOf(TestObjectGeneric::class.java)
assertThat(result.u).isEqualTo(111111)
}