assertFalse(savedTeamMembers.isEmpty());
assertEquals(1, savedTeamMembers.size());
}
public void testRemove() {
TeamMember teamMember1 =
new TeamMember(
new TenantId("12345"),
"jdoe",
"John",
"Doe",
"jdoe@saasovation.com",
new Date());
TeamMember teamMember2 =
new TeamMember(
new TenantId("12345"),
"zdoe",
"Zoe",
"Doe",
"zoe@saasovation.com",
new Date());
LevelDBUnitOfWork.start(this.database);
teamMemberRepository.save(teamMember1);
teamMemberRepository.save(teamMember2);
LevelDBUnitOfWork.current().commit();
LevelDBUnitOfWork.start(this.database);
teamMemberRepository.remove(teamMember1);
LevelDBUnitOfWork.current().commit();
TenantId tenantId = teamMember2.tenantId();
Collection<TeamMember> savedTeamMembers = teamMemberRepository.allTeamMembersOfTenant(tenantId);
assertFalse(savedTeamMembers.isEmpty());
assertEquals(1, savedTeamMembers.size());
assertEquals(teamMember2.username(), savedTeamMembers.iterator().next().username());
LevelDBUnitOfWork.start(this.database);
teamMemberRepository.remove(teamMember2);
LevelDBUnitOfWork.current().commit();