/** * Test when insert row and fetching it later. */ @Test public void testInsertRepoFileAndFetchItAgain() { RepoImage newRepoFileMap = getNewIsoRepoFile(); dao.addRepoFileMap(newRepoFileMap); List<RepoImage> listOfRepoFiles = dao.getRepoListForStorageDomain(FixturesTool.STORAGE_DOMAIN_NFS_ISO, ImageFileType.ISO); assertNotNull(listOfRepoFiles); assertFalse(listOfRepoFiles.isEmpty()); assertEquals(listOfRepoFiles.get(0).getRepoImageId(), newRepoFileMap.getRepoImageId()); assertEquals(listOfRepoFiles.get(0).getLastRefreshed(), newRepoFileMap.getLastRefreshed()); assertEquals(listOfRepoFiles.get(0).getSize(), newRepoFileMap.getSize()); assertEquals(listOfRepoFiles.get(0).getRepoDomainId(), newRepoFileMap.getRepoDomainId()); }
@Override public void addRepoFileMap(RepoImage map) { MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource().addValue("repo_domain_id", map.getRepoDomainId()) .addValue("repo_image_id", map.getRepoImageId()) .addValue("repo_image_name", map.getRepoImageName()) .addValue("size", map.getSize()) .addValue("date_created", map.getDateCreated()) .addValue("last_refreshed", map.getLastRefreshed()) .addValue("file_type", map.getFileType().getValue()); getCallsHandler().executeModification("InsertRepo_domain_file_meta_data", parameterSource); }