Skip to content

Commit

Permalink
Make yet another attempt to replicate MID-5912
Browse files Browse the repository at this point in the history
(not successful)
  • Loading branch information
mederly committed Jan 17, 2020
1 parent 4a48950 commit 5d1d692
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
Expand Up @@ -11,8 +11,10 @@
import com.evolveum.icf.dummy.resource.DummySyncStyle;
import com.evolveum.midpoint.audit.api.AuditEventStage;
import com.evolveum.midpoint.common.refinery.RefinedResourceSchemaImpl;
import com.evolveum.midpoint.model.api.ModelExecuteOptions;
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.prism.delta.ChangeType;
import com.evolveum.midpoint.prism.delta.ObjectDelta;
import com.evolveum.midpoint.schema.constants.MidPointConstants;
import com.evolveum.midpoint.schema.constants.SchemaConstants;
import com.evolveum.midpoint.schema.processor.ObjectClassComplexTypeDefinition;
Expand All @@ -39,6 +41,7 @@

import javax.xml.namespace.QName;

import static java.util.Collections.singleton;
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertNotNull;

Expand Down Expand Up @@ -272,6 +275,43 @@ public void test130ModifyMancombPhotoSourceAndReconcile() throws Exception {
notificationManager.setDisabled(true);
}

/**
* MID-5912 (changing the photo directly on service object; with reconcile)
*/
@Test
public void test140ModifyMancombPhotoInRepo() throws Exception {
final String TEST_NAME = "test140ModifyMancombPhotoInRepo";
displayTestTitle(TEST_NAME);

// GIVEN
Task task = createTask(TEST_NAME);
OperationResult result = task.getResult();

/// WHEN
displayWhen(TEST_NAME);

PrismObject<UserType> userMancomb = findUserByUsername(ACCOUNT_MANCOMB_DUMMY_USERNAME);
assertNotNull("User mancomb has disappeared", userMancomb);

ObjectDelta<UserType> delta = deltaFor(UserType.class)
.item(UserType.F_JPEG_PHOTO).replaceRealValues(singleton("cherry".getBytes(StandardCharsets.UTF_8)))
.asObjectDelta(userMancomb.getOid());
executeChanges(delta, ModelExecuteOptions.createReconcile(), task, result);

// THEN
displayThen(TEST_NAME);

assertSuccess(result);

PrismObject<UserType> userMancombAfter = repositoryService.getObject(UserType.class, userMancomb.getOid(),
schemaHelper.getOperationOptionsBuilder().retrieve().build(), result);
display("user mancomb after", userMancombAfter);

//assertJpegPhoto(UserType.class, userMancomb.getOid(), "beer".getBytes(StandardCharsets.UTF_8), result);

notificationManager.setDisabled(true);
}

/**
* MID-5197
*/
Expand Down
Expand Up @@ -106,8 +106,12 @@ An authoritative resource, used to test for MID-2100 (inbound mappings acting bo
<attribute>
<ref>ri:drink</ref>
<displayName>Drink</displayName>
<exclusiveStrong>false</exclusiveStrong>
<!-- <tolerant>false</tolerant>-->
<inbound>
<name>Badge Photo Mapping</name>
<authoritative>true</authoritative>
<exclusive>false</exclusive>
<strength>strong</strength>
<expression>
<script>
Expand Down

0 comments on commit 5d1d692

Please sign in to comment.