assertFalse(savedReleases.isEmpty());
assertEquals(1, savedReleases.size());
}
public void testRemove() {
Release release1 = new Release(
new TenantId("12345"), new ProductId("p00000"), new ReleaseId("r11111"),
"release1", "My release 1.", new Date(), new Date());
Release release2 = new Release(
new TenantId("12345"), new ProductId("p00000"), new ReleaseId("r11112"),
"release2", "My release 2.", new Date(), new Date());
LevelDBUnitOfWork.start(this.database);
releaseRepository.save(release1);
releaseRepository.save(release2);
LevelDBUnitOfWork.current().commit();
LevelDBUnitOfWork.start(this.database);
releaseRepository.remove(release1);
LevelDBUnitOfWork.current().commit();
TenantId tenantId = release2.tenantId();
ProductId productId = release2.productId();
Collection<Release> savedReleases = releaseRepository.allProductReleases(tenantId, productId);
assertFalse(savedReleases.isEmpty());
assertEquals(1, savedReleases.size());
assertEquals(release2.name(), savedReleases.iterator().next().name());
LevelDBUnitOfWork.start(this.database);
releaseRepository.remove(release2);
LevelDBUnitOfWork.current().commit();