UserProjectsLdapServiceImpl extends AbstractOpenEngSBConnectorService implements UserProjectsDomain { @Override public void updatePermissions(List<Permission> permissions) { for (Permission permission : permissions) { storeOverwriteExisting(EntryFactory.permissionStructure(permission)); } } 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 testUpdatePermissions_shouldCreatePermission() throws LdapInvalidAttributeValueException, NoSuchNodeException, MissingParentException { Permission permission = createTestPermission(); ldapService.updatePermissions(Lists.newArrayList(permission)); assertThat(ldapDao.exists(DnFactory.permission(permission)), is(true)); assertCorrectlyStored(permission); }
@Test public void testUpdatePermissions_shouldUpdatePermission() throws LdapInvalidAttributeValueException, NoSuchNodeException, MissingParentException { Permission permission = createTestPermission(); ldapService.updatePermissions(Lists.newArrayList(permission)); permission.setComponentName(permission.getComponentName() + "new"); permission.setAction(permission.getAction() + "new"); ldapService.updatePermissions(Lists.newArrayList(permission)); assertCorrectlyStored(permission); }