}
public void testRemove() throws Exception {
TenantId tenantId = new TenantId("T12345");
Product product1 =
new Product(
tenantId,
new ProductId("679890"),
new ProductOwnerId(tenantId, "thepm"),
"My Product 1",
"My product 1, which is my product.",
DiscussionAvailability.NOT_REQUESTED);
Product product2 =
new Product(
tenantId,
new ProductId("09876"),
new ProductOwnerId(tenantId, "thepm"),
"My Product 2",
"My product 2, which is my product.",
DiscussionAvailability.NOT_REQUESTED);
LevelDBUnitOfWork.start(this.database);
productRepository.save(product1);
productRepository.save(product2);
LevelDBUnitOfWork.current().commit();
LevelDBUnitOfWork.start(this.database);
productRepository.remove(product1);
LevelDBUnitOfWork.current().commit();
Collection<Product> savedProducts = productRepository.allProductsOfTenant(tenantId);
assertFalse(savedProducts.isEmpty());
assertEquals(1, savedProducts.size());
assertEquals(product2.productId(), savedProducts.iterator().next().productId());
LevelDBUnitOfWork.start(this.database);
productRepository.remove(product2);
LevelDBUnitOfWork.current().commit();