@Test
public void checkProgrammingLanguage() {

    logger.info("Setting up the projects...");
    Project p1 = new ProjectBuilder().commitsCount(10)
            .contributorsCount(5)
            .forksCount(1)
            .gitHubProjectId(12345)
            .description("bogus project 1")
            .name("bogus project 1")
            .primaryLanguage("Java")
            .organizationName("zalando-stups")
            .getProject();
    Project p2 = new ProjectBuilder().commitsCount(10)
            .contributorsCount(5)
            .forksCount(1)
            .gitHubProjectId(12345)
            .description("bogus project 2")
            .name("bogus project 2")
            .primaryLanguage("Scala")
            .organizationName("zalando-stups")
            .getProject();
    Project p3 = new ProjectBuilder().commitsCount(10)
            .contributorsCount(5)
            .forksCount(1)
            .gitHubProjectId(12345)
            .description("bogus project 3")
            .name("bogus project 3")
            .primaryLanguage("C++")
            .organizationName("zalando")
            .getProject();
    Project p4 = new ProjectBuilder().commitsCount(10)
            .contributorsCount(5)
            .forksCount(1)
            .gitHubProjectId(12345)
            .description("bogus project 4")
            .name("bogus project 4")
            .primaryLanguage(null)
            .organizationName("zalando")
            .getProject();
    projectRepository.save(p1);
    projectRepository.save(p2);
    projectRepository.save(p3);
    projectRepository.save(p4);
    String organizations = "zalando,zalando-stups";
    logger.info("Calling language service...");
    List<Project> projectsZalando = new ArrayList<>();
    List<Project> projectsZalandoStups = new ArrayList<>();
    projectsZalandoStups.add(p1);
    projectsZalandoStups.add(p2);
    projectsZalando.add(p3);
    projectsZalando.add(p4);
    // given
    when(projectRepository.findProjects("zalando", empty(), empty())).thenReturn(projectsZalando);
    when(projectRepository.findProjects("zalando-stups", empty(), empty())).thenReturn(projectsZalandoStups);
    // when
    List<Language> result = languageService.getMainLanguages(organizations, new LanguagePercentComparator(), empty());
    Assert.assertEquals(3, result.size());
}