feat!: JDK21 -> pattern matching, integration tests implementation & small fixes
This commit is contained in:
parent
2981691ffc
commit
720937bd6c
10 changed files with 184 additions and 49 deletions
|
@ -13,13 +13,8 @@ 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))
|
||||
);
|
||||
var entity = EntityCreator.userEntity().build();
|
||||
var expected = EntityCreator.user();
|
||||
assertThat(UserMapper.entityToPojo(entity))
|
||||
.usingRecursiveComparison()
|
||||
.isEqualTo(expected);
|
||||
|
@ -27,13 +22,8 @@ class UserMapperTest {
|
|||
|
||||
@Test
|
||||
void pojoToEntityTest() {
|
||||
var entity = new User(
|
||||
EntityCreator.Constants.NAME,
|
||||
EntityCreator.Constants.SURNAME,
|
||||
EntityCreator.Constants.PESEL,
|
||||
Map.of("PLN", new Currency("PLN", EntityCreator.Constants.PLN))
|
||||
);
|
||||
var expected = EntityCreator.user().build();
|
||||
var entity = EntityCreator.user();
|
||||
var expected = EntityCreator.userEntity().build();
|
||||
assertThat(UserMapper.pojoToEntity(entity))
|
||||
.usingRecursiveComparison()
|
||||
.isEqualTo(expected);
|
||||
|
@ -42,7 +32,7 @@ class UserMapperTest {
|
|||
@Test
|
||||
void requestToEntityTest() {
|
||||
var request = EntityCreator.userRequest().build();
|
||||
var expected = EntityCreator.user().build();
|
||||
var expected = EntityCreator.userEntity().build();
|
||||
assertThat(UserMapper.requestToEntity(request))
|
||||
.usingRecursiveComparison()
|
||||
.isEqualTo(expected);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue