package Ġcom . cost ular . mar vel hero es . mapper Ċ Ċ import Ġcom . cost ular . mar vel hero es . data . model . Mar vel Hero Ċ import Ġcom . cost ular . mar vel hero es . data . model . mapper . Mar vel Hero Mapper Ċ import Ġcom . cost ular . mar vel hero es . domain . model . Mar vel Hero Entity Ċ import Ġorg . assertj . core . api . Assertions Ċ import Ġorg . junit . Assert Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ Ċ /** Ċ Ġ* ĠCreated Ġby Ġcost ular Ġon Ġ 1 8 / 0 3 / 2 0 1 8 . Ċ Ġ*/ Ċ class ĠMar vel Hero Mapper Test Ġ{ ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġmar vel Hero Mapper : ĠMar vel Hero Mapper ĊĊĠĠĠ Ġ@ Before ĊĠĠĠ Ġfun ĠsetUp () Ġ{ ĊĠĠĠĠĠĠĠ Ġmar vel Hero Mapper Ġ= ĠMar vel Hero Mapper () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` Transform ĠMar vel Hero Ġinto ĠMar vel Hero Entity `() Ġ{ ĊĠĠĠĠĠĠĠ Ġ// ĠGiven ĊĠĠĠĠĠĠĠ Ġval Ġmar vel Hero Ġ= ĠMar vel Hero (" I ron ĠMan ", Ġ" http :// iron man . com ") ĊĊĠĠĠĠĠĠĠ Ġ// ĠWhen ĊĠĠĠĠĠĠĠ Ġval Ġmar vel Hero Entity Ġ= Ġmar vel Hero Mapper . transform ( mar vel Hero ) ĊĊĠĠĠĠĠĠĠ Ġ// ĠThen ĊĠĠĠĠĠĠĠ ĠAssertions . assertThat ( mar vel Hero Entity . name ). isEqualTo ( mar vel Hero . name ) ĊĠĠĠĠĠĠĠ ĠAssertions . assertThat ( mar vel Hero Entity . photoUrl ). isEqualTo ( mar vel Hero . photoUrl ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` Transform ĠMar vel Hero Ġcollection Ġinto ĠMar vel Hero Entity Ġcollection `() Ġ{ ĊĠĠĠĠĠĠĠ Ġ// ĠGiven ĊĠĠĠĠĠĠĠ Ġval Ġmar vel Hero es Ġ= ĠlistOf ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠMar vel Hero (" I ron ĠMan ", Ġ" http :// iron man . com ", Ġgroups Ġ= Ġ" 1 , Ġ 2 "), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠMar vel Hero (" Spider - Man ", Ġ" http :// spider - man . com ", Ġgroups Ġ= Ġ" 1 , Ġ 2 ") ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠĠĠĠĠ Ġ// ĠWhen ĊĠĠĠĠĠĠĠ Ġval Ġmar vel Hero es Entities Ġ= Ġmar vel Hero Mapper . transform List ( mar vel Hero es ) ĊĊĠĠĠĠĠĠĠ Ġ// ĠThen ĊĠĠĠĠĠĠĠ ĠAssertions . assertThat ( mar vel Hero es . size ). isEqualTo ( mar vel Hero es Entities . size ) ĊĠĠĠĠĠĠĠ ĠAssertions . assertThat ( mar vel Hero es Entities ). all Match Ġ{ Ġit Ġis ĠMar vel Hero Entity Ġ} ĊĠĠĠĠĠĠĠ ĠAssertions . assertThat ( mar vel Hero es Entities . first (). groups ). isEqualTo ( array Of (" 1 ", Ġ" 2 ")) ĊĠĠĠĠĠĠĠ ĠAssertions . assertThat ( mar vel Hero es Entities . first (). name ). isEqualTo ( mar vel Hero es . first (). name ) ĊĠĠĠĠĠĠĠ ĠAssertions . assertThat ( mar vel Hero es Entities . last (). name ). isEqualTo ( mar vel Hero es . last (). name ) ĊĠĠĠ Ġ} Ċ Ċ }