UserProjectsLdapServiceImpl extends AbstractOpenEngSBConnectorService implements UserProjectsDomain { @Override public void updateAssignments(List<Assignment> assignments) { for (Assignment assignment : assignments) { storeOverwriteExisting(EntryFactory.assignmentStructure(assignment)); } } 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 testUpdateAssignments_shouldCreateAssignment() throws LdapInvalidAttributeValueException, NoSuchNodeException, MissingParentException { Assignment assignment = createTestAssignment(); ldapService.updateAssignments(Lists.newArrayList(assignment)); assertThat(ldapDao.exists(DnFactory.assignment(assignment)), is(true)); assertCorrectlyStored(assignment); }
@Test public void testUpdateAssignments_shouldUpdateAssignment() throws LdapInvalidAttributeValueException, NoSuchNodeException, MissingParentException { Assignment assignment = createTestAssignment(); ldapService.updateAssignments(Lists.newArrayList(assignment)); assignment.getPermissions().add("new"); assignment.getRoles().add("new"); ldapService.updateAssignments(Lists.newArrayList(assignment)); assertCorrectlyStored(assignment); }