	@Test
	public void testCountNameDistinctlyWithTeamId() {

		assertEquals(0, jobService.countNameDistinctly());
		
		TeamLampsDTO team = teamService.create(new TeamCreateDTO("Team 1"));
		LampDTO lampDTO = lampService.create(new LampCreateDTO("hueId", "Lampe 1", team.getId()));
		
		assertEquals(0, jobService.countNameDistinctly(team.getId()));
		
		LampUpdateDTO lampUpdateDTO = new LampUpdateDTO();
		lampUpdateDTO.setId(lampDTO.getId());

		lampUpdateDTO.setBuildingConfigs(new ArrayList<>());
		lampUpdateDTO.setFailureConfigs(new ArrayList<>());
		lampUpdateDTO.setUnstableConfigs(new ArrayList<>());
		lampUpdateDTO.setSuccessConfigs(new ArrayList<>());
		List<ScenarioConfigDTO> scenarioConfigs2 = lampDTO.getScenarioConfigs();
		for(ScenarioConfigDTO config : scenarioConfigs2) {
			String scenario = config.getScenario().toString();
			if(scenario.startsWith(BuildState.BUILDING.toString())) {
				lampUpdateDTO.getBuildingConfigs().add(config);
			} else if(scenario.startsWith(BuildState.FAILURE.toString())) {
				lampUpdateDTO.getFailureConfigs().add(config);
			} else if(scenario.startsWith(BuildState.UNSTABLE.toString())) {
				lampUpdateDTO.getUnstableConfigs().add(config);
			} else if(scenario.startsWith(BuildState.SUCCESS.toString())) {
				lampUpdateDTO.getSuccessConfigs().add(config);
			}
		}
		
		List<String> jobNames = Arrays.asList("JobA", "JobB", "JobB", "JobB");
		List<JobDTO> jobs = new ArrayList<>();
		for(String name : jobNames) {
			jobs.add(new JobDTO(0, name));
		}
		lampUpdateDTO.setJobs(jobs);
		lampUpdateDTO.setWorkingStart(lampDTO.getWorkingStart());
		lampUpdateDTO.setWorkingEnd(lampDTO.getWorkingEnd());
		lampService.update(lampUpdateDTO);
		
		assertEquals(2, jobService.countNameDistinctly(team.getId()));
		assertEquals(0, jobService.countNameDistinctly(654846215));
	}