DuraStoreSyncEndpoint implements SyncEndpoint { private void addUpdateContent(String contentId, MonitoredFile syncFile, String absPath) throws ContentStoreException { logger.info("Adding local file {} to DuraCloud space {}" + " with content ID {}", absPath, spaceId, contentId); addUpdateContent(contentId, syncFile); } DuraStoreSyncEndpoint(ContentStore contentStore,
                                 String username,
                                 String spaceId,
                                 boolean syncDeletes,
                                 boolean syncUpdates,
                                 boolean renameUpdates,
                                 boolean jumpStart,
                                 String updateSuffix,
                                 String prefix);  DuraStoreSyncEndpoint(ContentStore contentStore,
                                 String username,
                                 String spaceId,
                                 boolean syncDeletes,
                                 boolean jumpStart); @Override boolean syncFile(MonitoredFile syncFile, File watchDir); @Override SyncResultType syncFileAndReturnDetailedResult(MonitoredFile syncFile,
                                                          File watchDir); @Override void deleteContent(String spaceId, String contentId); Iterator<String> getFilesList(); @Override void addEndPointListener(EndPointListener listener); @Override void removeEndPointListener(EndPointListener listener);  }
@Test public void testAddUpdateFile() throws Exception { String contentId = "contentId"; String content = "content-file"; FileUtils.writeStringToFile(contentFile, content); ChecksumUtil checksumUtil = new ChecksumUtil(ChecksumUtil.Algorithm.MD5); String checksum = checksumUtil.generateChecksum(contentFile); Capture<Map<String, String>> propsCapture = new Capture<>(); EasyMock.expect(contentStore.addContent(EasyMock.eq(spaceId), EasyMock.eq(contentId), EasyMock.isA(InputStream.class), EasyMock.eq(contentFile.length()), EasyMock.eq("text/plain"), EasyMock.eq(checksum), EasyMock.capture(propsCapture))) .andReturn(""); replayMocks(); setEndpoint(null, false); MonitoredFile monitoredFile = new MonitoredFile(contentFile); endpoint.addUpdateContent(contentId, monitoredFile); Map<String, String> props = propsCapture.getValue(); assertNotNull(props); }