}
@Test
public void testCheckExistanceOfEmptyPolicies() {
final Passport agentId = new Passport("АВ", "468454");
final Account agent = new Account(new Employee(agentId, "Иванов", "Иван"));
final Set<UserRoles> firstAgentUserRoles = new TreeSet<UserRoles>();
firstAgentUserRoles.add(UserRoles.ROLE_AGENT);
agent.setAssociatedRoles(firstAgentUserRoles);
userDAO.persist(agent);
final PolicyType policyTypeHouse = new PolicyType("HOUSE", "House insurance type");
final PolicySeries houseSeriesOne = new PolicySeries("HOM");
houseSeriesOne.setPolicyType(policyTypeHouse);
policyTypeHouse.getTypeSeries().add(houseSeriesOne);
entityManager.persist(policyTypeHouse);
for (long i = 1; i <= 5; i++) {
final BlankPolicy blankPolicy = new BlankPolicy(new PolicyId(houseSeriesOne, i));
blankPolicy.setInventoryPolicyState(BlankState.FILLED);
blankPolicy.setAgent(agent.getEmployee());
entityManager.persist(blankPolicy);
}
for (long i = 6; i <= 10; i++) {
final BlankPolicy blankPolicy = new BlankPolicy(new PolicyId(houseSeriesOne, i));
entityManager.persist(blankPolicy);