ProjectService { public List<Project> getAllProjects() { return projectRepo.findAll(); }  boolean pathContainsCompileableForGame(final String path, final GameData game); List<Project> getAllProjects(); Project saveProject(final Project project); void build(final Iterable<Project> projects, final boolean useCmdLineSettings); void deleteProject(final Project project); List<Project> getProjectsOfPath(final String path); @Transactional RuleSet fetchBestCompressionRuleSet(final Project project); void createTemplateProjectFiles(final Project project);  }
@Test public void testGetAllProjects() { final Project project1 = new Project("name1", "path1", Game.SC2); project1.setId(1); final Project project2 = new Project("name2", "path2", Game.HEROES); project2.setId(2); when(projectRepoMock.findAll()).thenReturn(Arrays.asList(project1, project2)); final int numberOfProjects = projectService.getAllProjects().size(); assertEquals(2, numberOfProjects, "not fetching all existing projects"); }