Package org.springframework.ldap.core

Examples of org.springframework.ldap.core.DirContextOperations.attributeExists()


        final String username = "johnldap";
        User user = new UserImpl("123", username);

        expect(userService.getUserByUsername(username)).andReturn(null).once();
        expect(ctx.attributeExists(MAIL_ATTRIBUTE_NAME)).andReturn(true);
        expect(ctx.getStringAttribute(MAIL_ATTRIBUTE_NAME)).andReturn("johnldap@example.com").times(2);
        expect(ctx.attributeExists(DISPLAY_NAME_ATTRIBUTE_NAME)).andReturn(true);
        expect(ctx.getStringAttribute(DISPLAY_NAME_ATTRIBUTE_NAME)).andReturn("John Ldap");
        expect(userService.getUserByUsername(username)).andReturn(user).once();
        expectLastCall();
View Full Code Here


        User user = new UserImpl("123", username);

        expect(userService.getUserByUsername(username)).andReturn(null).once();
        expect(ctx.attributeExists(MAIL_ATTRIBUTE_NAME)).andReturn(true);
        expect(ctx.getStringAttribute(MAIL_ATTRIBUTE_NAME)).andReturn("johnldap@example.com").times(2);
        expect(ctx.attributeExists(DISPLAY_NAME_ATTRIBUTE_NAME)).andReturn(true);
        expect(ctx.getStringAttribute(DISPLAY_NAME_ATTRIBUTE_NAME)).andReturn("John Ldap");
        expect(userService.getUserByUsername(username)).andReturn(user).once();
        expectLastCall();

        replay(userService, ctx);
View Full Code Here

        final String username = "johnldap";
        User user = new UserImpl("123", username);

        expect(userService.getUserByUsername(username)).andReturn(null).once();
        expect(ctx.attributeExists(MAIL_ATTRIBUTE_NAME)).andReturn(true);
        expect(ctx.getStringAttribute(MAIL_ATTRIBUTE_NAME)).andReturn("johnldap@example.com").times(2);
        expect(ctx.attributeExists(DISPLAY_NAME_ATTRIBUTE_NAME)).andReturn(false);
        expect(userService.getUserByUsername(username)).andReturn(user).once();
        expectLastCall();
View Full Code Here

        User user = new UserImpl("123", username);

        expect(userService.getUserByUsername(username)).andReturn(null).once();
        expect(ctx.attributeExists(MAIL_ATTRIBUTE_NAME)).andReturn(true);
        expect(ctx.getStringAttribute(MAIL_ATTRIBUTE_NAME)).andReturn("johnldap@example.com").times(2);
        expect(ctx.attributeExists(DISPLAY_NAME_ATTRIBUTE_NAME)).andReturn(false);
        expect(userService.getUserByUsername(username)).andReturn(user).once();
        expectLastCall();

        replay(userService, ctx);
View Full Code Here

        DirContextOperations ctx = createMock(DirContextOperations.class);

        final String username = "johnldap";

        expect(userService.getUserByUsername(username)).andReturn(null).once();
        expect(ctx.attributeExists(MAIL_ATTRIBUTE_NAME)).andReturn(false);

        replay(userService, ctx);

        contextMapper.mapUserFromContext(ctx, username, Collections.<GrantedAuthority>emptyList());
View Full Code Here

        DirContextOperations ctx = createMock(DirContextOperations.class);

        final String username = "johnldap";

        expect(userService.getUserByUsername(username)).andReturn(null).once();
        expect(ctx.attributeExists(MAIL_ATTRIBUTE_NAME)).andReturn(true);
        expect(ctx.getStringAttribute(MAIL_ATTRIBUTE_NAME)).andReturn("").times(1);

        replay(userService, ctx);

        contextMapper.mapUserFromContext(ctx, username, Collections.<GrantedAuthority>emptyList());
View Full Code Here

        final String username = "johnldap";
        User user = new UserImpl(123L, username);

        expect(userService.getUserByUsername(username)).andReturn(null).once();
        expect(ctx.attributeExists(MAIL_ATTRIBUTE_NAME)).andReturn(true);
        expect(ctx.getStringAttribute(MAIL_ATTRIBUTE_NAME)).andReturn("johnldap@example.com").times(2);
        expect(ctx.attributeExists(DISPLAY_NAME_ATTRIBUTE_NAME)).andReturn(true);
        expect(ctx.getStringAttribute(DISPLAY_NAME_ATTRIBUTE_NAME)).andReturn("John Ldap");
        expect(userService.getUserByUsername(username)).andReturn(user).once();
        expectLastCall();
View Full Code Here

        User user = new UserImpl(123L, username);

        expect(userService.getUserByUsername(username)).andReturn(null).once();
        expect(ctx.attributeExists(MAIL_ATTRIBUTE_NAME)).andReturn(true);
        expect(ctx.getStringAttribute(MAIL_ATTRIBUTE_NAME)).andReturn("johnldap@example.com").times(2);
        expect(ctx.attributeExists(DISPLAY_NAME_ATTRIBUTE_NAME)).andReturn(true);
        expect(ctx.getStringAttribute(DISPLAY_NAME_ATTRIBUTE_NAME)).andReturn("John Ldap");
        expect(userService.getUserByUsername(username)).andReturn(user).once();
        expectLastCall();

        replay(userService, ctx);
View Full Code Here

        final String username = "johnldap";
        User user = new UserImpl(123L, username);

        expect(userService.getUserByUsername(username)).andReturn(null).once();
        expect(ctx.attributeExists(MAIL_ATTRIBUTE_NAME)).andReturn(true);
        expect(ctx.getStringAttribute(MAIL_ATTRIBUTE_NAME)).andReturn("johnldap@example.com").times(2);
        expect(ctx.attributeExists(DISPLAY_NAME_ATTRIBUTE_NAME)).andReturn(false);
        expect(userService.getUserByUsername(username)).andReturn(user).once();
        expectLastCall();
View Full Code Here

        User user = new UserImpl(123L, username);

        expect(userService.getUserByUsername(username)).andReturn(null).once();
        expect(ctx.attributeExists(MAIL_ATTRIBUTE_NAME)).andReturn(true);
        expect(ctx.getStringAttribute(MAIL_ATTRIBUTE_NAME)).andReturn("johnldap@example.com").times(2);
        expect(ctx.attributeExists(DISPLAY_NAME_ATTRIBUTE_NAME)).andReturn(false);
        expect(userService.getUserByUsername(username)).andReturn(user).once();
        expectLastCall();

        replay(userService, ctx);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.