@Test public void initShouldCreateDirectories(@Mocked final Files unused) { new FileSystemStorageService(mockOdeProperties).init(); try { new Verifications() { { Files.createDirectory((Path) any); times = 1; } }; } catch (IOException e) { fail("Unexpected exception in verifications block: " + e); } }
@Override public void init() { try { Files.createDirectory(rootLocation); } catch (IOException e) { EventLogger.logger.info("Failed to initialize storage service {}", this.rootLocation); throw new StorageException("Failed to initialize storage service " + this.rootLocation, e); } }
FileSystemStorageService implements StorageService { @Override public void init() { try { Files.createDirectory(rootLocation); } catch (IOException e) { EventLogger.logger.info("Failed to initialize storage service {}", this.rootLocation); throw new StorageException("Failed to initialize storage service " + this.rootLocation, e); } } }
FileSystemStorageService implements StorageService { @Override public void init() { try { Files.createDirectory(rootLocation); } catch (IOException e) { EventLogger.logger.info("Failed to initialize storage service {}", this.rootLocation); throw new StorageException("Failed to initialize storage service " + this.rootLocation, e); } } @Autowired  FileSystemStorageService(OdeProperties properties); }
FileSystemStorageService implements StorageService { @Override public void init() { try { Files.createDirectory(rootLocation); } catch (IOException e) { EventLogger.logger.info("Failed to initialize storage service {}", this.rootLocation); throw new StorageException("Failed to initialize storage service " + this.rootLocation, e); } } @Autowired  FileSystemStorageService(OdeProperties properties); @Override void store(MultipartFile file, String type); @Override Stream<Path> loadAll(); @Override Path load(String filename); @Override Resource loadAsResource(String filename); @Override void deleteAll(); @Override void init(); Path getRootLocation(); void setRootLocation(Path rootLocation); }
FileSystemStorageService implements StorageService { @Override public void init() { try { Files.createDirectory(rootLocation); } catch (IOException e) { EventLogger.logger.info("Failed to initialize storage service {}", this.rootLocation); throw new StorageException("Failed to initialize storage service " + this.rootLocation, e); } } @Autowired  FileSystemStorageService(OdeProperties properties); @Override void store(MultipartFile file, String type); @Override Stream<Path> loadAll(); @Override Path load(String filename); @Override Resource loadAsResource(String filename); @Override void deleteAll(); @Override void init(); Path getRootLocation(); void setRootLocation(Path rootLocation);  }