improve test coverage
This commit is contained in:
parent
4ca89df6fd
commit
d34e1f9e14
@ -1,5 +1,6 @@
|
||||
package net.hostsharing.hsadminng.hs.office.person;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.EnumSource;
|
||||
|
||||
@ -15,10 +16,19 @@ class HsOfficePersonTypeConverterUnitTest {
|
||||
assertThat(converter.convertToDatabaseColumn(given)).isEqualTo(given.shortName);
|
||||
}
|
||||
|
||||
@Test
|
||||
void mapsNullToDatabaseValue() {
|
||||
assertThat(converter.convertToDatabaseColumn(null)).isEqualTo(null);
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@EnumSource(HsOfficePersonType.class)
|
||||
void mapsFromDatabaseValue(final HsOfficePersonType given) {
|
||||
assertThat(converter.convertToEntityAttribute(given.shortName)).isEqualTo(given);
|
||||
}
|
||||
|
||||
@Test
|
||||
void mapsNullFromDatabaseValue() {
|
||||
assertThat(converter.convertToEntityAttribute(null)).isEqualTo(null);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user