fix: Request validation in UserService
This commit is contained in:
parent
1eee6b1b48
commit
7e38b5a2e0
9 changed files with 126 additions and 26 deletions
|
@ -15,23 +15,23 @@ class UserMapperTest {
|
|||
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))
|
||||
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);
|
||||
.usingRecursiveComparison()
|
||||
.isEqualTo(expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
void requestToEntityTest() {
|
||||
var request = EntityCreator.userRequest();
|
||||
var request = EntityCreator.userRequest().build();
|
||||
var expected = EntityCreator.user().build();
|
||||
assertThat(UserMapper.requestToEntity(request))
|
||||
.usingRecursiveComparison()
|
||||
.isEqualTo(expected);
|
||||
.usingRecursiveComparison()
|
||||
.isEqualTo(expected);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue