@Throws(Exception::class) fun testExceptionWithEmpty() { val mapper = ObjectMapper() try { val result: Any = mapper.readValue(" ", Any::class.java) fail("Expected an exception, but got result value: $result") } catch (e: Exception) { verifyException(e, EOFException::class.java, "No content") } }
Simple test to check behavior when end-of-stream is encountered without content . Should throw EOFException .