@Secured("ROLE_USER") @RequestMapping(value = {"", "/", "/dashboard"}) public String dashboardUser(Model model) { String username = userService.getMyUsername(); model.addAttribute("users", userService.findOneByUsername(username)); model.addAttribute("posts", blogRepository.findAllByAuthor(username)); model.addAttribute("url", "user"); return "authorized/dashboard"; }
/** * Java 8 / Hibernate Date * * @author <*****@*****.**>< */ @Test public void selectAllRecordAndPrint() { List<Blog> lstBlog = blogRepository.findAll(); for (Blog blog : lstBlog) { System.out.println("Username is: " + blog.getAuthor() + " and Date: " + blog.getBlodate()); assertThat( blog.getBlodate(), is(LocalDate.parse("2015-09-15"))); // Dia De La Independencia De México } }