SerializableCacheItem implements Serializable, CacheItem { public static CacheItem parse(Properties object) { Optional<LocalDateTime> time = HeaderUtils.fromHttpDate(new Header("cache-time", object.getProperty("cache-time"))); Status status = Status.valueOf(NumberUtils.toInt(object.getProperty("status"), 200)); Headers headers = Headers.parse(object.getProperty("headers")); Optional<Payload> p = Optional.empty(); if (object.containsKey("file")) { p = Optional.of(new FilePayload(new File(object.getProperty("file")), headers.getContentType().orElse(MIMEType.APPLICATION_OCTET_STREAM))); } return new DefaultCacheItem(new HTTPResponse(p, status, headers), time.get()); } SerializableCacheItem(CacheItem item); long getTTL(); boolean isStale(LocalDateTime requestTime); long getAge(LocalDateTime dateTime); LocalDateTime getCachedTime(); HTTPResponse getResponse(); Properties toProperties(); static CacheItem parse(Properties object);  }
@Test public void paseCacheItemWithoutContentType() { Properties properties = new Properties(); properties.setProperty("cache-time", "Mon, 12 May 2014 20:06:46 GMT"); CacheItem item = SerializableCacheItem.parse(properties); Assert.assertNotNull(item); }