Package org.jtalks.jcommune.service.nontransactional

Examples of org.jtalks.jcommune.service.nontransactional.EncryptionService


    @Test
    public void userShouldBeRegisteredUsingEncryptedPassword() throws Exception{
        String password = "password";
        RegisterUserDto registerUserDto = createRegisterUserDto("username", password, "email@email.em", null);
        EncryptionService realEncryptionService = new EncryptionService(new Md5PasswordEncoder());
        TransactionalAuthenticator authenticatorSpy = spy(new TransactionalAuthenticator(pluginLoader, userDao, groupDao,
                realEncryptionService, mailService, avatarService, pluginService,
                securityFacade, rememberMeServices, sessionStrategy, validator, authenticationManager));

        authenticatorSpy.register(registerUserDto);
        UserDto expected = new UserDto();
        expected.setEmail("email@email.em");
        expected.setUsername("username");
        expected.setPassword(realEncryptionService.encryptPassword(password));

        verify(authenticatorSpy).registerByPlugin(refEq(expected), eq(true), any(BindingResult.class));
        verify(authenticatorSpy).storeRegisteredUser(refEq(expected));
    }
View Full Code Here

TOP

Related Classes of org.jtalks.jcommune.service.nontransactional.EncryptionService

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.