ProjectService { public Project getProject(String projectId, UserEntity requestingUser) { return project(loadProjectEntity(projectId), requestingUser); } @Autowired  ProjectService(ProjectRepository projectRepository,
                          PledgeRepository pledgeRepository,
                          UserRepository userRepository,
                          FinancingRoundRepository financingRoundRepository,
                          UserNotificationService userNotificationService,
                          FinancingRoundService financingRoundService,
                          LikeRepository likeRepository,
                          ProjectAttachmentRepository projectAttachmentRepository); Project getProject(String projectId, UserEntity requestingUser); List<Project> getProjects(UserEntity requestingUser); Project addProject(Project project, UserEntity creator); Project modifyProjectStatus(String projectId, ProjectStatus newStatusToApply, UserEntity requestingUser); Project modifyProjectMasterdata(String projectId, Project modifiedProject, UserEntity requestingUser); void pledge(String projectId, UserEntity userEntity, Pledge pledge); Attachment addProjectAttachment(String projectId, Attachment attachment, UserEntity savingUser); Attachment loadProjectAttachment(String projectId, Attachment attachmentRequest); void deleteProjectAttachment(String projectId, Attachment attachmentRequest, UserEntity deletingUser); void likeProject(String projectId, UserEntity user); void unlikeProject(String projectId, UserEntity user);  }
@Test public void getProject_shouldReturnDefaultLikeCountAndLikeStatus() throws Exception { final UserEntity projectCreator = user(USER_EMAIL); final ProjectEntity projectEntity = projectEntity("projectId", ProjectStatus.PROPOSED, projectCreator); when(projectRepository.findOne(anyString())).thenReturn(projectEntity); when(likeRepository.findOneByProjectAndUser(any(ProjectEntity.class), any(UserEntity.class))).thenReturn(Optional.empty()); final Project project = projectService.getProject("projectId", projectCreator); assertThat(project, hasProperty("likeCount", equalTo(0L))); assertThat(project, hasProperty("likeStatusOfRequestUser", equalTo(UNLIKE))); }