assertFalse(savedProductOwners.isEmpty());
assertEquals(1, savedProductOwners.size());
}
public void testRemove() {
ProductOwner productOwner1 =
new ProductOwner(
new TenantId("12345"),
"jdoe",
"John",
"Doe",
"jdoe@saasovation.com",
new Date());
ProductOwner productOwner2 =
new ProductOwner(
new TenantId("12345"),
"zdoe",
"Zoe",
"Doe",
"zoe@saasovation.com",
new Date());
LevelDBUnitOfWork.start(this.database);
productOwnerRepository.save(productOwner1);
productOwnerRepository.save(productOwner2);
LevelDBUnitOfWork.current().commit();
LevelDBUnitOfWork.start(this.database);
productOwnerRepository.remove(productOwner1);
LevelDBUnitOfWork.current().commit();
TenantId tenantId = productOwner2.tenantId();
Collection<ProductOwner> savedProductOwners = productOwnerRepository.allProductOwnersOfTenant(tenantId);
assertFalse(savedProductOwners.isEmpty());
assertEquals(1, savedProductOwners.size());
assertEquals(productOwner2.username(), savedProductOwners.iterator().next().username());
LevelDBUnitOfWork.start(this.database);
productOwnerRepository.remove(productOwner2);
LevelDBUnitOfWork.current().commit();