@Test public void save() { given(projectRepo.save(projectMock)).willReturn(projectMock); Project savedProject = projectService.save(projectMock); assertThat(savedProject).isEqualTo(projectMock); verify(projectRepo).save(projectMock); }
@Override public Project save(Project project) { return projectRepo.save(project); }
RepositoryProjectService implements ProjectService { @Override public Project save(Project project) { return projectRepo.save(project); } }
RepositoryProjectService implements ProjectService { @Override public Project save(Project project) { return projectRepo.save(project); } @Autowired  RepositoryProjectService(ProjectRepository projectRepo,
                                    ProjectApplicationRepository applicationRepo,
                                    UserRepository userRepo,
                                    UserService userService,
                                    Clock clock); }
RepositoryProjectService implements ProjectService { @Override public Project save(Project project) { return projectRepo.save(project); } @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 Project save(Project project) { return projectRepo.save(project); } @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);  }