@Test
public void findMostRecentProjectsTest() throws Exception {

	// given
	Date snapshotDate = new Date(System.currentTimeMillis());
	Project p = new ProjectBuilder().snapshotDate(snapshotDate).gitHubProjectId(1).organizationName(ORGANIZATION1)
			.starsCount(1).commitsCount(2).contributorsCount(1).score(20).forksCount(0).create();
	when(projectRepository.findProjects(ORGANIZATION1, snapshotDate, empty(), empty()))
			.thenReturn(singletonList(p));
	when(projectRepository.findProjects(ORGANIZATION1, empty(), empty())).thenReturn(singletonList(p));
	// when
	List<Project> projectList = (List<Project>) projectService.findProjects(ORGANIZATION1, empty(), empty(),
			Optional.of(snapshotDate), empty(), empty(), empty(), empty());
	// then
	assertThat(projectList, hasSize(1));
	assertThat(projectList.get(0), equalTo(p));
}