DuracloudContentWriter implements ContentWriter { @Override public String writeSingle(String spaceId, String chunkChecksum, ChunkInputStream chunk, Map<String, String> properties) throws NotFoundException { log.debug("writeSingle: " + spaceId + ", " + chunk.getChunkId()); createSpaceIfNotExist(spaceId); addChunk(spaceId, chunkChecksum, chunk, properties, true); log.debug("written: " + spaceId + ", " + chunk.getChunkId()); return chunk.getMD5(); } DuracloudContentWriter(ContentStore contentStore, String username);  DuracloudContentWriter(ContentStore contentStore,
                                  String username,
                                  int maxRetries,
                                  int waitInMsBetweenRetries);  DuracloudContentWriter(ContentStore contentStore,
                                  String username,
                                  boolean throwOnError,
                                  boolean jumpStart);  DuracloudContentWriter(ContentStore contentStore,
                                  String username,
                                  boolean throwOnError,
                                  boolean jumpStart,
                                  int maxRetries,
                                  int waitInMsBetweenRetries); int getMaxRetries(); List<AddContentResult> getResults(); void ignore(String spaceId, String contentId, long contentSize); @Override ChunksManifest write(String spaceId,
                                ChunkableContent chunkable,
                                Map<String, String> contentProperties); @Override ChunksManifest write(String spaceId, ChunkableContent chunkable); @Override String writeSingle(String spaceId,
                              String chunkChecksum,
                              ChunkInputStream chunk,
                              Map<String, String> properties); @Override String writeSingle(String spaceId,
                              String chunkChecksum,
                              ChunkInputStream chunk);  }
@Test public void testWriteSingle() throws Exception { createMockContentStore(true, true); replayMocks(); long contentSize = 1000; InputStream contentStream = createContentStream(contentSize); String spaceId = "test-spaceId-1"; String contentId = "test-contentId-1"; boolean preserveMD5 = true; ChunkInputStream chunk = new ChunkInputStream(contentId, contentStream, contentSize, preserveMD5); DuracloudContentWriter writer = new DuracloudContentWriter(contentStore, username); String md5 = writer.writeSingle(spaceId, "checksum", chunk); Assert.assertNotNull(md5); EasyMock.verify(contentStore); }