From d34e1f9e142e0b24cec859d4b7cb829f04234f0f Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Wed, 24 Jan 2024 15:56:34 +0100 Subject: [PATCH] improve test coverage --- .../person/HsOfficePersonTypeConverterUnitTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/test/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonTypeConverterUnitTest.java b/src/test/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonTypeConverterUnitTest.java index 93283f2b..1077d462 100644 --- a/src/test/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonTypeConverterUnitTest.java +++ b/src/test/java/net/hostsharing/hsadminng/hs/office/person/HsOfficePersonTypeConverterUnitTest.java @@ -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); + } }