improve test coverage

This commit is contained in:
Michael Hoennig 2024-01-24 15:56:34 +01:00
parent 4ca89df6fd
commit d34e1f9e14

View File

@ -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);
}
}