}
public void testStartDiscussionInitiationSave() throws Exception {
TenantId tenantId = new TenantId("T12345");
Product product =
new Product(
tenantId,
new ProductId("679890"),
new ProductOwnerId(tenantId, "thepm"),
"My Product",
"My product, which is my product.",
DiscussionAvailability.NOT_REQUESTED);
product.startDiscussionInitiation("ABCDEFGHIJ");
LevelDBUnitOfWork.start(this.database);
productRepository.save(product);
LevelDBUnitOfWork.current().commit();
Product savedProduct =
productRepository
.productOfDiscussionInitiationId(
product.tenantId(),
"ABCDEFGHIJ");
assertNotNull(savedProduct);
assertEquals(product.tenantId(), savedProduct.tenantId());
assertEquals(product.productId(), savedProduct.productId());
assertEquals(product.productOwnerId(), savedProduct.productOwnerId());
assertEquals("My Product", savedProduct.name());
assertEquals("My product, which is my product.", savedProduct.description());
assertEquals(DiscussionAvailability.NOT_REQUESTED, savedProduct.discussion().availability());
}