feat: POJO mappers
This commit is contained in:
parent
b947f95305
commit
3121caf8f7
3 changed files with 68 additions and 0 deletions
28
src/test/java/eu/ztsh/wymiana/util/UserMapperTest.java
Normal file
28
src/test/java/eu/ztsh/wymiana/util/UserMapperTest.java
Normal file
|
@ -0,0 +1,28 @@
|
|||
package eu.ztsh.wymiana.util;
|
||||
|
||||
import eu.ztsh.wymiana.EntityCreator;
|
||||
import eu.ztsh.wymiana.model.Currency;
|
||||
import eu.ztsh.wymiana.model.User;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
class UserMapperTest {
|
||||
|
||||
@Test
|
||||
void entityToPojoTest() {
|
||||
var entity = EntityCreator.user().build();
|
||||
var expected = new User(
|
||||
EntityCreator.Constants.NAME,
|
||||
EntityCreator.Constants.SURNAME,
|
||||
EntityCreator.Constants.PESEL,
|
||||
Map.of("PLN", new Currency("PLN", EntityCreator.Constants.PLN))
|
||||
);
|
||||
assertThat(UserMapper.entityToPojo(entity))
|
||||
.usingRecursiveComparison()
|
||||
.isEqualTo(expected);
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue