FSBlobSerializer extends BlobSerializer implements BlobDeserializer, Closeable { private boolean errorBlob(String value) { return value.startsWith(ERROR_MARKER); } FSBlobSerializer(File dir);  FSBlobSerializer(File dir, int maxInlineSize); @Override String serialize(Blob blob); @Override Blob deserialize(String value); @Override void close();  }
@Test public void errorBlob() throws Exception{ FSBlobSerializer serializer = new FSBlobSerializer(folder.getRoot(), 1); String blobValue = serializer.serialize(new BadBlob()); try{ Blob b = serializer.deserialize(blobValue); assertEquals("foo", b.getContentIdentity()); b.getNewStream(); fail(); } catch (RuntimeException ignore){ } }