@Test
    void testInvalidHeaderCacheEntry() {
        final String content1 = HttpByteArrayCacheEntrySerializer.HC_CACHE_VERSION_LINE + "\n" +
                "HC-Key: unique-cache-key\n" +
                "HC-Resource-Length: 11\n" +
                "HC-Request-Instant: boom\n" +
                "HC-Response-Instant: 1686210849596\n" +
                "\n" +
                "GET /stuff HTTP/1.1\n" +
                "\n" +
                "HTTP/1.1 200 \n" +
                "Content-Type: text/plain; charset=UTF-8\n" +
                "Cache-control: public, max-age=31536000\n" +
                "\n" +
                "Hello World";
        final byte[] bytes1 = content1.getBytes(StandardCharsets.UTF_8);
        final ResourceIOException exception1 = Assertions.assertThrows(ResourceIOException.class, () ->
                httpCacheEntrySerializer.deserialize(bytes1));
        Assertions.assertEquals("Invalid cache header format", exception1.getMessage());
        final String content2 = HttpByteArrayCacheEntrySerializer.HC_CACHE_VERSION_LINE + "\n" +
                "HC-Key: unique-cache-key\n" +
                "HC-Resource-Length: 11\n" +
                "HC-Request-Instant: 1686210849596\n" +
                "HC-Response-Instant: boom\n" +
                "\n" +
                "GET /stuff HTTP/1.1\n" +
                "\n" +
                "HTTP/1.1 200 \n" +
                "Content-Type: text/plain; charset=UTF-8\n" +
                "Cache-control: public, max-age=31536000\n" +
                "\n" +
                "Hello World";
        final byte[] bytes2 = content2.getBytes(StandardCharsets.UTF_8);
        final ResourceIOException exception2 = Assertions.assertThrows(ResourceIOException.class, () ->
                httpCacheEntrySerializer.deserialize(bytes2));
        Assertions.assertEquals("Invalid cache header format", exception2.getMessage());
    }
Deserialize cache entries with an invalid header value.
httpclient5-cache/src/test/java/org/apache/hc/client5/http/impl/cache/TestHttpByteArrayCacheEntrySerializer.java