StorageFileDaoHelper { public List<StorageFileEntity> createStorageFileEntitiesFromStorageFiles(StorageUnitEntity storageUnitEntity, List<StorageFile> storageFiles) { List<StorageFileEntity> storageFileEntities = new ArrayList<>(); for (StorageFile storageFile : storageFiles) { StorageFileEntity storageFileEntity = new StorageFileEntity(); storageFileEntities.add(storageFileEntity); storageFileEntity.setStorageUnit(storageUnitEntity); storageFileEntity.setPath(storageFile.getFilePath()); storageFileEntity.setFileSizeBytes(storageFile.getFileSizeBytes()); storageFileEntity.setRowCount(storageFile.getRowCount()); } storageFileDao.saveStorageFiles(storageFileEntities); return storageFileEntities; }  List<StorageFileEntity> createStorageFileEntitiesFromStorageFiles(StorageUnitEntity storageUnitEntity, List<StorageFile> storageFiles); StorageFileEntity getStorageFileEntity(String storageName, String filePath); StorageFileEntity getStorageFileEntity(StorageUnitEntity storageUnitEntity, String filePath, BusinessObjectDataKey businessObjectDataKey);  }
@Test public void testCreateStorageFileEntitiesFromStorageFiles() { StorageUnitEntity storageUnitEntity = new StorageUnitEntity(); List<StorageFile> storageFiles = Lists.newArrayList(new StorageFile(FILE_NAME, FILE_SIZE, ROW_COUNT), new StorageFile(FILE_NAME_2, FILE_SIZE_2, ROW_COUNT_2)); List<StorageFileEntity> result = storageFileDaoHelper.createStorageFileEntitiesFromStorageFiles(storageUnitEntity, storageFiles); assertThat("Result size not equal to two.", result.size(), is(2)); assertThat("File size not equal.", result.get(0).getFileSizeBytes(), is(FILE_SIZE)); assertThat("Row count not equal.", result.get(0).getRowCount(), is(ROW_COUNT)); assertThat("File size not equal.", result.get(1).getFileSizeBytes(), is(FILE_SIZE_2)); assertThat("Row count not equal.", result.get(1).getRowCount(), is(ROW_COUNT_2)); verify(storageFileDao).saveStorageFiles(argumentCaptor.capture()); verifyNoMoreInteractionsHelper(); }