diff --git a/hiero-spring/src/test/java/com/openelements/hiero/spring/test/FileClientTests.java b/hiero-spring/src/test/java/com/openelements/hiero/spring/test/FileClientTests.java index a465be9..3c6dc69 100644 --- a/hiero-spring/src/test/java/com/openelements/hiero/spring/test/FileClientTests.java +++ b/hiero-spring/src/test/java/com/openelements/hiero/spring/test/FileClientTests.java @@ -26,6 +26,7 @@ void testNullParams() { Assertions.assertThrows(NullPointerException.class, () -> fileClient.readFile((FileId) null)); Assertions.assertThrows(NullPointerException.class, () -> fileClient.deleteFile((String) null)); Assertions.assertThrows(NullPointerException.class, () -> fileClient.deleteFile((FileId) null)); + Assertions.assertThrows(NullPointerException.class, () -> fileClient.getExpirationTime(null)); } @Test @@ -200,6 +201,14 @@ void testGetExpirationTime() throws Exception { Assertions.assertTrue(expirationTime.isBefore(definedExpirationTime.plusSeconds(1))); } + @Test + void testGetExpirationTimeForFailures() { + //given + final FileId invalidFileId = FileId.fromString("1.2.3"); + //then + Assertions.assertThrows(HieroException.class, () -> fileClient.getExpirationTime(invalidFileId)); + } + @Test @Disabled("Always fails with AUTORENEW_DURATION_NOT_IN_RANGE. Needs to be investigated further.") void testUpdateExpirationTime() throws Exception {