use of sample.jpa.domain.Note in project spring-boot by spring-projects.
the class IndexController method index.
@GetMapping("/")
@Transactional(readOnly = true)
public ModelAndView index() {
List<Note> notes = this.noteRepository.findAll();
ModelAndView modelAndView = new ModelAndView("index");
modelAndView.addObject("notes", notes);
return modelAndView;
}
use of sample.jpa.domain.Note in project spring-boot by spring-projects.
the class JpaNoteRepositoryIntegrationTests method findsAllNotes.
@Test
public void findsAllNotes() {
List<Note> notes = this.repository.findAll();
assertThat(notes).hasSize(4);
for (Note note : notes) {
assertThat(note.getTags().size()).isGreaterThan(0);
}
}
Aggregations