Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
coolsamson7 committed Mar 21, 2024
1 parent 9a20cef commit 3dad1d7
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions portal/core/src/test/java/com/serious/portal/mapper/MapperTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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")}
}
)

Expand All @@ -60,9 +59,9 @@ class MapperTest {

product.mutableInnerComposite?.price = Money("EU",1)


val result = mapper.map<Product>(product)

println()
assertEquals(1, result?.mutableInnerComposite?.price?.value)
assertEquals(1, result?.innerComposite?.price?.value)
}
}

0 comments on commit 3dad1d7

Please sign in to comment.