@Override public void read() { Product p = dao.read(6L); Assert.assertNotNull(p); Assert.assertEquals(p.getIdentifier(), "prod6"); Download dl = p.getDownload(); Map<String, String> checksums = dl.getChecksums(); Assert.assertEquals(checksums.get("MD5"), "abc"); }
@Override public void update() { String productIdentifier = "test-prod-7"; String indexName = "updatable"; Long pid = Long.valueOf(7); Product product = dao.read(pid); List<MetadataIndex> indexes = product.getIndexes(); product.setIdentifier(productIdentifier); for (MetadataIndex mi : indexes) { mi.setName(indexName); } dao.setIndexes(pid, indexes); dao.update(product); product = dao.read(pid); indexes = product.getIndexes(); Assert.assertNotNull(product); Assert.assertEquals(product.getIdentifier(), productIdentifier); for (MetadataIndex mi : indexes) { Assert.assertEquals(mi.getName(), indexName); } }