Package aim.domain.security

Examples of aim.domain.security.Account


    }

    @Test
    public void testGetAgentById() {
        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 Employee foundAgent = agentDAO.getAgentByID(agentId);
        assertEquals(agent.getEmployee().getId().getNumber(), foundAgent.getId().getNumber());
        assertEquals(agent.getEmployee().getId().getSeries(), foundAgent.getId().getSeries());
    }
View Full Code Here


    @Test
    @Ignore
    public void testFindByOffice() {
        final int agentFromKievCount = 1;
        final Passport firstAgentId = new Passport("АВ", "468454");
        final Account firstAgent = new Account(new Employee(firstAgentId, "Иванов", "Иван"));
        final Set<UserRoles> firstAgentUserRoles = new TreeSet<UserRoles>();
        firstAgentUserRoles.add(UserRoles.ROLE_AGENT);
        firstAgent.setAssociatedRoles(firstAgentUserRoles);
        userDAO.persist(firstAgent);
        final Office office = new Office("Kiev");
        userDAO.persist(office);
        firstAgent.getEmployee().setOffice(office);

        final Passport secondAgentId = new Passport("АВ", "468454");
        final Account secondAgent = new Account(new Employee(secondAgentId, "Иванов", "Иван"));
        final List<UserRoles> secondAgentUserRoles = new ArrayList<UserRoles>();
        secondAgentUserRoles.add(UserRoles.ROLE_AGENT);
        secondAgent.setAssociatedRoles(firstAgentUserRoles);
        userDAO.persist(secondAgent);

        final List<Employee> foundAgents = agentDAO.findAgentsByFLPandOffice(UserSearchCriteria.createCriteria().setOffice("ie"));

        assertNotNull(foundAgents);
View Full Code Here

    @Test
    public void testGetAgentsPolicyWithinDate() {
        final Passport agentId = new Passport("АВ", "100500");
        final Employee employee = new Employee(agentId, "Иванов", "Иван");
        final Account agent = new Account(employee);
        final Set<UserRoles> firstAgentUserRoles = new TreeSet<UserRoles>();
        firstAgentUserRoles.add(UserRoles.ROLE_AGENT);
        agent.setAssociatedRoles(firstAgentUserRoles);
        userDAO.persist(agent);

        final PolicySeries serie = new PolicySeries("LS");
        final PolicyType type = new PolicyType("WEAPOS", "For Norris C. ");
        type.getTypeSeries().add(serie);
View Full Code Here

TOP

Related Classes of aim.domain.security.Account

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.