Package org.shams.phonebook.domain.impl

Examples of org.shams.phonebook.domain.impl.User


    @Test
    public void load() {
        service.save(getUser());
        assertEquals(1, countRowsInTable("_user"));
        User user = (User) ((UserDetailsService) service).loadUserByUsername("demo");
        assertNotNull(user);
        assertEquals(user.getPassword(), "demo");
    }
View Full Code Here


        assertEquals(user.getPassword(), "demo");
    }


    private User getUser() {
        User u = new User();
        u.setName("demo user");
        u.setUsername("demo");
        u.setPassword("demo");
        return u;
    }
View Full Code Here

        }
    }

    public User getUser() {
        if (user == null) {
            user = new User();
        }
        return user;
    }
View Full Code Here

                user.getName(), user.getUsername(), user.getPassword());
    }

    private class UserRowMapper implements ParameterizedRowMapper<User> {
        public User mapRow(ResultSet rs, int i) throws SQLException {
            return new User(
                    rs.getLong("id"),
                    rs.getString("name"),
                    rs.getString("username"),
                    rs.getString("password")
            );
View Full Code Here

        dao.save(getUser());
    }

    public void load() {
        dao.save(getUser());
        User user = dao.load("demo");
        Assert.assertNotNull(user);
        Assert.assertNotNull(user.getId());
        Assert.assertEquals(user.getUsername(), "demo");
        Assert.assertEquals(user.getPassword(), "demo");
    }
View Full Code Here

        Assert.assertEquals(user.getUsername(), "demo");
        Assert.assertEquals(user.getPassword(), "demo");
    }

    private User getUser() {
        User user = new User();
        user.setName("demo user");
        user.setUsername("demo");
        user.setPassword("demo");
        return user;
    }
View Full Code Here

TOP

Related Classes of org.shams.phonebook.domain.impl.User

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.