@Test public void canBeReconstitutedFromByteArray() throws Exception { String key = impl.getStorageKey(); HttpCacheEntry entry = impl.getHttpCacheEntry(); byte[] bytes = impl.toByteArray(); impl = new MemcachedCacheEntryImpl(); impl.set(bytes); assertEquals(key, impl.getStorageKey()); assertEquivalent(entry, impl.getHttpCacheEntry()); }
@Test public void canBeSerialized() { byte[] bytes = impl.toByteArray(); assertNotNull(bytes); assertTrue(bytes.length > 0); }