"Domain Model",
BacklogItemType.FEATURE,
BacklogItemStatus.PLANNED,
StoryPoints.EIGHT);
Release release = new Release(
new TenantId("12345"), new ProductId("p00000"), new ReleaseId("r11111"),
"release1", "My release 1.", new Date(), new Date());
Sprint sprint = new Sprint(
new TenantId("12345"), new ProductId("p00000"), new SprintId("s11111"),
"sprint1", "My sprint 1.", new Date(), new Date());
backlogItem2.scheduleFor(release);
backlogItem2.commitTo(sprint);
backlogItem3.scheduleFor(release);
LevelDBUnitOfWork.start(this.database);
backlogItemRepository.save(backlogItem1);
backlogItemRepository.save(backlogItem2);
backlogItemRepository.save(backlogItem3);
LevelDBUnitOfWork.current().commit();
Collection<BacklogItem> savedBacklogItems =
backlogItemRepository
.allProductBacklogItems(backlogItem1.tenantId(), backlogItem1.productId());
assertFalse(savedBacklogItems.isEmpty());
assertEquals(3, savedBacklogItems.size());
savedBacklogItems =
backlogItemRepository
.allOutstandingProductBacklogItems(backlogItem1.tenantId(), backlogItem1.productId());
assertFalse(savedBacklogItems.isEmpty());
assertEquals(3, savedBacklogItems.size());
savedBacklogItems =
backlogItemRepository
.allBacklogItemsComittedTo(sprint.tenantId(), sprint.sprintId());
assertFalse(savedBacklogItems.isEmpty());
assertEquals(1, savedBacklogItems.size());
savedBacklogItems =
backlogItemRepository
.allBacklogItemsScheduledFor(release.tenantId(), release.releaseId());
assertFalse(savedBacklogItems.isEmpty());
assertEquals(2, savedBacklogItems.size());
LevelDBUnitOfWork.start(this.database);
backlogItemRepository.remove(backlogItem2);
LevelDBUnitOfWork.current().commit();
savedBacklogItems =
backlogItemRepository
.allOutstandingProductBacklogItems(backlogItem1.tenantId(), backlogItem1.productId());
assertFalse(savedBacklogItems.isEmpty());
assertEquals(2, savedBacklogItems.size());
savedBacklogItems =
backlogItemRepository
.allBacklogItemsComittedTo(sprint.tenantId(), sprint.sprintId());
assertTrue(savedBacklogItems.isEmpty());
savedBacklogItems =
backlogItemRepository
.allBacklogItemsScheduledFor(release.tenantId(), release.releaseId());
assertFalse(savedBacklogItems.isEmpty());
assertEquals(1, savedBacklogItems.size());
LevelDBUnitOfWork.start(this.database);
backlogItemRepository.remove(backlogItem3);
LevelDBUnitOfWork.current().commit();
savedBacklogItems =
backlogItemRepository
.allBacklogItemsScheduledFor(release.tenantId(), release.releaseId());
assertTrue(savedBacklogItems.isEmpty());
savedBacklogItems =
backlogItemRepository