chore: Formatting fixes
This commit is contained in:
parent
94dd43c138
commit
4fcc395a61
3 changed files with 16 additions and 16 deletions
|
@ -1,6 +1,6 @@
|
|||
package eu.ztsh.wymiana.exception;
|
||||
|
||||
public class ExchangeFailedException extends RuntimeException{
|
||||
public class ExchangeFailedException extends RuntimeException {
|
||||
|
||||
public ExchangeFailedException() {
|
||||
this("An exchange error has occurred");
|
||||
|
|
|
@ -53,7 +53,7 @@ public class CurrencyService {
|
|||
}
|
||||
|
||||
private Currency create(String symbol) {
|
||||
// TODO: check if supported
|
||||
// TODO: check if supported - now limited to PLN <-> USD
|
||||
return new Currency(symbol.toUpperCase(), 0D);
|
||||
}
|
||||
|
||||
|
|
|
@ -15,28 +15,28 @@ 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 pojoToEntityTest() {
|
||||
var entity = 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))
|
||||
);
|
||||
var expected = EntityCreator.user().build();
|
||||
assertThat(UserMapper.pojoToEntity(entity))
|
||||
.usingRecursiveComparison()
|
||||
.isEqualTo(expected);
|
||||
.usingRecursiveComparison()
|
||||
.isEqualTo(expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -44,8 +44,8 @@ class UserMapperTest {
|
|||
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