ObjectManagerBean implements ObjectManager { @Override public ResultFile getObject(ObjectFetchingRequest request) throws ObjectNotFoundException, FetchingException { Profiler.profile("Object fetch request"); ContentVersion contentVersion = objectFinder.getObjectsVersion(request.getIdentifier(), request.getVersion()); try { Profiler.start("fetching object content"); String rootFolder = contentFetcher.fetchEntireObject(contentVersion, request.getProvided(), request.getExtracted()); File root = new File(rootFolder); Profiler.stop("fetching object content"); Profiler.start("preparing zip archive"); ArchiveBuilder archiveBuilder = new ZipArchiveBuilder(Arrays.asList(root.listFiles()), new File( root.getParent() + File.separator + root.getName() + ".zip")); ResultFile result = new ResultFile(archiveBuilder.buildArchive(), createFileName(request.getIdentifier(), contentVersion.getVersion())); Profiler.stop("preparing zip archive"); Profiler.dump(); return result; } catch (DataStorageException e) { throw new FetchingException("Could not fetch the object from the data store.", e); } catch (ArchiverException e) { throw new FetchingException("Could not prepare archive with the object's contents.", e); } }  @Override String createObject(ObjectCreationRequest request); @Override int modifyObject(ObjectModificationRequest request); @Override int deleteVersion(ObjectVersionDeletionRequest request); @Override void deleteObject(ObjectDeletionRequest request); @Override ObjectFiles getFilesList(String identifier, Integer version, Boolean provided, Boolean extracted,
            Boolean hashes, Boolean absolute); @Override ObjectHistory getHistory(String identifier, boolean ascending); @Override ResultFile getObject(ObjectFetchingRequest request); @Override ResultFile getContentFiles(FileFetchingRequest request); @Override ResultFile getContentFile(String objectId, Integer version, String filePath); @Override ResultFile getMainFile(FileFetchingRequest request); @Override ResultFile getMetadata(String identifier, Integer version, boolean provided); @Override String getMetsForObject(String identifier, Integer version); @Override MetadataSectionsCollection getMetsMetadataSection(String identifier, String mid); @Override InputStream getMetadataSectionById(String eid, String mid); @Override InputStream getMetadataSectionById(String eid, String mid, Integer vid); @Override InputStream getMetadataSectionById(String eid, String mid, Integer vid, String fid); @Override Map<String, String> getFilesIdLocationMap(String identifier); @Override Map<String, String> getFilesIdLocationMap(String identifier, Integer vid);  }
@Test(expected = ObjectNotFoundException.class) public void shouldGetObjectNotFoundException() throws Exception { ObjectFetchingRequest request = new ObjectFetchingRequest("oai:darceo.psnc.pl:0", 1, true, true); objectManager.getObject(request); }