From d0e2490e3e81f0db9f148f0365eed4dcd920f1ca Mon Sep 17 00:00:00 2001 From: Sam Leeflang Date: Wed, 20 Nov 2024 16:13:15 +0100 Subject: [PATCH] Add test --- .../location/MaximumDepthInMetersTest.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/test/java/eu/dissco/core/translator/terms/specimen/location/MaximumDepthInMetersTest.java b/src/test/java/eu/dissco/core/translator/terms/specimen/location/MaximumDepthInMetersTest.java index 5b760b5..6bbed1d 100644 --- a/src/test/java/eu/dissco/core/translator/terms/specimen/location/MaximumDepthInMetersTest.java +++ b/src/test/java/eu/dissco/core/translator/terms/specimen/location/MaximumDepthInMetersTest.java @@ -41,6 +41,20 @@ void testRetrieveFromDWCANull() { // Then assertThat(result).isNull(); } + + @Test + void testRetrieveFromDWCAUnSanitizable() { + // Given + var unit = MAPPER.createObjectNode(); + unit.put("dwc:maximumDepthInMeters", "235 ft"); + + // When + var result = maximumDepthInMeters.retrieveFromDWCA(unit); + + // Then + assertThat(result).isEqualTo("235 ft"); + } + @ParameterizedTest @ValueSource(strings = {"-350m.", "-350meter", "-350 m", "-350 MTR"}) void testRetrieveFromABCD(String input) {