assertEquals(DiscussionAvailability.REQUESTED, productWithRequestedDiscussion.discussion().availability());
}
public void testRetryProductDiscussionRequest() throws Exception {
Product product = this.persistedProductForTest();
this.productApplicationService.requestProductDiscussion(
new RequestProductDiscussionCommand(
product.tenantId().id(),
product.productId().id()));
Product productWithRequestedDiscussion =
this.productRepository
.productOfId(
product.tenantId(),
product.productId());
assertEquals(DiscussionAvailability.REQUESTED, productWithRequestedDiscussion.discussion().availability());
this.productApplicationService.startDiscussionInitiation(
new StartDiscussionInitiationCommand(
product.tenantId().id(),
product.productId().id()));
Product productWithDiscussionInitiation =
this.productRepository
.productOfId(
product.tenantId(),
product.productId());
assertNotNull(productWithDiscussionInitiation.discussionInitiationId());
this.productApplicationService.retryProductDiscussionRequest(
new RetryProductDiscussionRequestCommand(
product.tenantId().id(),
productWithDiscussionInitiation.discussionInitiationId()));
Product productWithRetriedRequestedDiscussion =
this.productRepository
.productOfId(
product.tenantId(),
product.productId());
assertEquals(DiscussionAvailability.REQUESTED, productWithRetriedRequestedDiscussion.discussion().availability());
}