@Test public void saveAll() { List<Project> expectedProjects = Collections.singletonList(projectMock); given(projectRepo.saveAll(expectedProjects)).willReturn(expectedProjects); List<Project> savedProjects = projectService.saveAll(expectedProjects); assertThat(savedProjects).isEqualTo(expectedProjects); verify(projectRepo).saveAll(expectedProjects); }
@Override public List<Project> saveAll(List<Project> projects) { return projectRepo.saveAll(projects); }
RepositoryProjectService implements ProjectService { @Override public List<Project> saveAll(List<Project> projects) { return projectRepo.saveAll(projects); } }
RepositoryProjectService implements ProjectService { @Override public List<Project> saveAll(List<Project> projects) { return projectRepo.saveAll(projects); } @Autowired  RepositoryProjectService(ProjectRepository projectRepo,
                                    ProjectApplicationRepository applicationRepo,
                                    UserRepository userRepo,
                                    UserService userService,
                                    Clock clock); }
RepositoryProjectService implements ProjectService { @Override public List<Project> saveAll(List<Project> projects) { return projectRepo.saveAll(projects); } @Autowired  RepositoryProjectService(ProjectRepository projectRepo,
                                    ProjectApplicationRepository applicationRepo,
                                    UserRepository userRepo,
                                    UserService userService,
                                    Clock clock); @Override @Transactional(readOnly = true) Project getProjectById(String projectId); @Override @Transactional(readOnly = true) boolean projectExists(String projectId); @Override Project save(Project project); @Override List<Project> saveAll(List<Project> projects); @Override Project createProject(Project project); }
RepositoryProjectService implements ProjectService { @Override public List<Project> saveAll(List<Project> projects) { return projectRepo.saveAll(projects); } @Autowired  RepositoryProjectService(ProjectRepository projectRepo,
                                    ProjectApplicationRepository applicationRepo,
                                    UserRepository userRepo,
                                    UserService userService,
                                    Clock clock); @Override @Transactional(readOnly = true) Project getProjectById(String projectId); @Override @Transactional(readOnly = true) boolean projectExists(String projectId); @Override Project save(Project project); @Override List<Project> saveAll(List<Project> projects); @Override Project createProject(Project project);  }