Package org.neo4j.cineasts.domain

Examples of org.neo4j.cineasts.domain.User


    private final static Logger logger = LoggerFactory.getLogger(UserController.class);

    @RequestMapping(value = "/user", method = RequestMethod.GET)
    public String profile(Model model) {
        final User user = userDetailsService.getUserFromSession();
        model.addAttribute("user", user);
        if (user!=null) {
            model.addAttribute("recommendations", movieRepository.getRecommendations(user));
        }
        return "/user/index";
View Full Code Here


    return "forward:/user/"+login;
    }

    @RequestMapping(value = "/user/{login}")
    public String publicProfile(Model model, @PathVariable("login") String login) {
        User profiled = userDetailsService.findUser(login);
        User user = userDetailsService.getUserFromSession();

        return publicProfile(model, profiled, user);
    }
View Full Code Here

    @Test
    public void testGetMovieRecommendations() throws Exception {
        Movie movie = movieRepository.save(new Movie("1", "Test-Movie"));
        Movie movie2 = movieRepository.save(new Movie("2", "Test-Movie2"));
        User user = userRepository.save(new User("me", "me", "me"));
        user.rate(template,movie,3,"me");
        User friend = userRepository.save(new User("friend", "friend", "friend"));
        friend.rate(template, movie, 5, "friend");
        friend.rate(template, movie2, 3, "friend2");
        assertEquals(2,movieRepository.count());
        final List<MovieRecommendation> recommendations = movieRepository.getRecommendations(user);
        assertEquals("one recommendation", 1, recommendations.size());
        assertEquals("one recommendation", movie2, recommendations.get(0).getMovie());
        assertEquals("one recommendation", 3, recommendations.get(0).getRating());
View Full Code Here

        assertEquals("one recommendation", 3, recommendations.get(0).getRating());
    }
    @Test
    public void testRateMovie() throws Exception {
        Movie movie = movieRepository.save(new Movie("1", "Test-Movie"));
        User user = userRepository.save(new User("me", "me", "me"));
        user.rate(template, movie, 5, "comment");
        movie = movieRepository.findById("1");
        final Rating rating = IteratorUtil.first(movie.getRatings());
        assertEquals("rating stars", 5, rating.getStars());
        assertEquals("rating comment", "comment", rating.getComment());
        assertEquals("rating user", user, rating.getUser());
View Full Code Here

TOP

Related Classes of org.neo4j.cineasts.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.