Package org.jamesdbloom.domain

Examples of org.jamesdbloom.domain.User


    @Resource
    private EmailService emailService;

    @RequestMapping(value = "/sendUpdatePasswordEmail", method = {RequestMethod.GET, RequestMethod.POST}, produces = "application/json; charset=UTF-8")
    public String sendUpdatePasswordEmail(String email, HttpServletRequest request, RedirectAttributes redirectAttributes) throws MalformedURLException, UnsupportedEncodingException {
        User user = userDAO.findByEmail(email);
        if (user != null) {
            user.setOneTimeToken(uuidFactory.generateUUID());
            userDAO.save(user);
            emailService.sendUpdatePasswordMessage(user, request);
        }
        redirectAttributes.addFlashAttribute("message", "An email has been sent to " + email + " with a link to create your password and login");
        redirectAttributes.addFlashAttribute("title", "Message Sent");
View Full Code Here


                // then
                .andExpect(redirectedUrl("/message"))
                .andExpect(flash().attributeExists("message"))
                .andExpect(flash().attribute("title", "Account Created"));

        User actualUser = userDAO.findByEmail(expectedUser.getEmail());

        try {
            assertThat(actualUser.getName(), is(expectedUser.getName()));
            assertThat(actualUser.getEmail(), is(expectedUser.getEmail()));
        } finally {
            userDAO.delete(actualUser.getId());
        }
    }
View Full Code Here

    }

    @Test
    public void shouldGetPageWithEmailAlreadyTakenError() throws Exception {
        // given
        userDAO.save(new User("already_exists_id", "test name", "already_taken@email.com", "Password123"));

        // when
        MvcResult mvcResult = mockMvc.perform(
                post("/register")
                        .secure(true)
View Full Code Here

TOP

Related Classes of org.jamesdbloom.domain.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.