Skip to content

Commit

Permalink
Fixed MID-3140: SaaS story - in org view delete selected user removes…
Browse files Browse the repository at this point in the history
… user from midPoint but not from LDAP
  • Loading branch information
mederly committed Jun 14, 2016
1 parent eb5008b commit e779870
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
Expand Up @@ -372,7 +372,7 @@ public void yesPerformed(AjaxRequestTarget target) {
private void deleteMemberConfirmPerformed(QueryScope scope, QName relation, AjaxRequestTarget target) {
getPageBase().hideMainPopup(target);
Task operationalTask = getPageBase().createSimpleTask(getTaskName("Delete", scope, false));
ObjectDelta delta = ObjectDelta.createDeleteDelta(ObjectType.class, "fakeOid", getPageBase().getPrismContext());
ObjectDelta delta = ObjectDelta.createDeleteDelta(FocusType.class, "fakeOid", getPageBase().getPrismContext());
if (delta == null) {
return;
}
Expand Down
Expand Up @@ -15,10 +15,6 @@
*/
package com.evolveum.midpoint.model.intest;

import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertFalse;
import static org.testng.AssertJUnit.assertNull;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
Expand All @@ -28,6 +24,7 @@

import javax.xml.bind.JAXBException;

import com.evolveum.midpoint.model.api.ModelExecuteOptions;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.DirtiesContext;
Expand Down Expand Up @@ -61,6 +58,8 @@
import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType;

import static org.testng.AssertJUnit.*;

/**
* This is testing the DEPRECATED functions of model API. It should be removed once the functions are phased out.
*
Expand Down Expand Up @@ -411,4 +410,26 @@ public void test210AddUserMorganWithAssignment() throws Exception {
assertDefaultDummyAccount("morgan", "Sir Henry Morgan", true);
}

@Test
public void test220DeleteUserMorgan() throws Exception {
TestUtil.displayTestTile(this, "test220DeleteUserMorgan");

// GIVEN
Task task = taskManager.createTaskInstance(TestModelCrudService.class.getName() + ".test220DeleteUserMorgan");
OperationResult result = task.getResult();
assumeAssignmentPolicy(AssignmentPolicyEnforcementType.FULL);

// WHEN
modelCrudService.deleteObject(UserType.class, USER_MORGAN_OID, ModelExecuteOptions.createReconcile(), task, result);

// THEN
try {
getUser(USER_MORGAN_OID);
fail("User morgan exists even if he should not");
} catch (ObjectNotFoundException e) {
// ok
}

assertNoDummyAccountById(null, "morgan");
}
}

0 comments on commit e779870

Please sign in to comment.