From 3dad1d775f66ce6afad41f452a87658fa060aaa9 Mon Sep 17 00:00:00 2001 From: Andreas Ernst Date: Thu, 21 Mar 2024 14:57:24 +0100 Subject: [PATCH] test fix --- .../com/serious/portal/mapper/MapperTest.kt | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/portal/core/src/test/java/com/serious/portal/mapper/MapperTest.kt b/portal/core/src/test/java/com/serious/portal/mapper/MapperTest.kt index 6f219b70..a4a4e49e 100644 --- a/portal/core/src/test/java/com/serious/portal/mapper/MapperTest.kt +++ b/portal/core/src/test/java/com/serious/portal/mapper/MapperTest.kt @@ -38,19 +38,18 @@ class MapperTest { fun test() { val mapper = Mapper( - Mapping.build(MutableInnerComposite::class, MutableInnerComposite::class) { - map { properties() } - }, - - Mapping.build(InnerComposite::class, InnerComposite::class) { - map { properties() } - }, - Mapping.build(Money::class, Money::class) { map { properties() } }, Mapping.build(Product::class, Product::class) { - map { properties() } + map { "id" to "id"} + map { Product::isNull to Product::isNull} + + map { path("innerComposite", "price", "value") to path("innerComposite", "price", "value")} + map { path("innerComposite", "price", "currency") to path("innerComposite", "price", "currency")} + + map { path("mutableInnerComposite", "price", "value") to path("mutableInnerComposite", "price", "value")} + map { path("mutableInnerComposite", "price", "currency") to path("mutableInnerComposite", "price", "currency")} } ) @@ -60,9 +59,9 @@ class MapperTest { product.mutableInnerComposite?.price = Money("EU",1) - val result = mapper.map(product) - println() + assertEquals(1, result?.mutableInnerComposite?.price?.value) + assertEquals(1, result?.innerComposite?.price?.value) } } \ No newline at end of file