Package org.eurekastreams.server.persistence

Examples of org.eurekastreams.server.persistence.PersonMapper


     * Test mappers are called correctly and non-null is returned.
     */
    @Test
    public void testLoadUserByUsername()
    {
        final PersonMapper personMapper = context.mock(PersonMapper.class);
        final PersistentLoginRepository loginRepo = context.mock(PersistentLoginRepository.class);

        context.checking(new Expectations()
        {
            {
View Full Code Here


     * Test mappers are called correctly and non-null is returned.
     */
    @Test
    public void testLoadUserByUsernameWithAuthorityProvider()
    {
        final PersonMapper personMapper = context.mock(PersonMapper.class);
        final PersistentLoginRepository loginRepo = context.mock(PersistentLoginRepository.class);
        final AuthorityProvider authProvider = context.mock(AuthorityProvider.class);
        final ArrayList<GrantedAuthority> auths = new ArrayList<GrantedAuthority>();
        auths.add(context.mock(GrantedAuthority.class));

View Full Code Here

     * Test that expected exception is tossed if mappers throw exception.
     */
    @Test(expected = DataRetrievalFailureException.class)
    public void testLoadUserByUsernameDataException()
    {
        final PersonMapper personMapper = context.mock(PersonMapper.class);

        context.checking(new Expectations()
        {
            {
                oneOf(personMapper).findByAccountId(with("username"));
View Full Code Here

     * Test that expected exception is tossed if username not found in data store.
     */
    @Test(expected = UsernameNotFoundException.class)
    public void testLoadUserByUsernamePersonNotFound()
    {
        final PersonMapper personMapper = context.mock(PersonMapper.class);

        context.checking(new Expectations()
        {
            {
                oneOf(personMapper).findByAccountId(with("username"));
View Full Code Here

     *             when anything goes wrong
     */
    @Override
    protected Person getDomainEntity(final String inName, final HttpServletRequest request) throws ServletException
    {
        PersonMapper personMapper = (PersonMapper) getSpringContext().getBean("jpaPersonMapper");

        Person outPerson = personMapper.findByAccountId(inName);

        if (outPerson == null)
        {
            throw new ServletException("User:  " + inName + " not found");
        }
View Full Code Here

TOP

Related Classes of org.eurekastreams.server.persistence.PersonMapper

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.