UserProjectsLdapServiceImpl extends AbstractOpenEngSBConnectorService implements UserProjectsDomain { @Override public void updateProjects(List<Project> projects) { for (Project project : projects) { storeOverwriteExisting(EntryFactory.projectStructure(project)); } } UserProjectsLdapServiceImpl();  UserProjectsLdapServiceImpl(LdapDao ldapDao); @Override AliveState getAliveState(); void setLdapDao(LdapDao dao); @Override void updateAssignments(List<Assignment> assignments); @Override void updatePermissions(List<Permission> permissions); @Override void updateProjects(List<Project> projects); @Override void updateRoles(List<Role> roles); @Override void updateUsers(List<User> users); @Override void deleteAssignments(List<Assignment> assignments); @Override void deletePermissions(List<Permission> permissions); @Override void deleteProjects(List<Project> projects); @Override void deleteRoles(List<Role> roles); @Override void deleteUsers(List<User> users);  }
@Test public void testUpdateProjects_shouldCreateProject() throws LdapInvalidAttributeValueException, NoSuchNodeException, MissingParentException { Project project = createTestProject(); ldapService.updateProjects(Lists.newArrayList(project)); assertThat(ldapDao.exists(DnFactory.project(project)), is(true)); assertAttributesCorrectlyStored(project); }
@Test public void testUpdateProjects_shouldUpdateProject() throws LdapInvalidAttributeValueException, NoSuchNodeException, MissingParentException { Project project = createTestProject(); ldapService.updateProjects(Lists.newArrayList(project)); project.getAttributes().add(createTestAttribute("attr88", "val88")); ldapService.updateProjects(Lists.newArrayList(project)); assertAttributesCorrectlyStored(project); }