use of com.evolveum.midpoint.repo.sqale.qmodel.role.MService in project midpoint by Evolveum.
the class SqaleRepoModifyObjectTest method test116DeleteIntegerAttribute.
@Test
public void test116DeleteIntegerAttribute() throws ObjectAlreadyExistsException, ObjectNotFoundException, SchemaException {
OperationResult result = createOperationResult();
given("delta with display order replace to null for service 1");
ObjectDelta<ServiceType> delta = prismContext.deltaFor(ServiceType.class).item(ServiceType.F_DISPLAY_ORDER).replace().asObjectDelta(service1Oid);
and("service row previously having the display order value");
MService originalRow = selectObjectByOid(QService.class, service1Oid);
assertThat(originalRow.displayOrder).isNotNull();
when("modifyObject is called");
repositoryService.modifyObject(ServiceType.class, service1Oid, delta.getModifications(), result);
then("operation is successful");
assertThatOperationResult(result).isSuccess();
and("serialized form (fullObject) is updated and display order is gone");
ServiceType serviceObject = repositoryService.getObject(ServiceType.class, service1Oid, null, result).asObjectable();
assertThat(serviceObject.getVersion()).isEqualTo(String.valueOf(originalRow.version + 1));
assertThat(serviceObject.getDisplayOrder()).isNull();
and("externalized column is set to NULL");
MService row = selectObjectByOid(QService.class, service1Oid);
assertThat(row.version).isEqualTo(originalRow.version + 1);
assertThat(row.displayOrder).isNull();
}
use of com.evolveum.midpoint.repo.sqale.qmodel.role.MService in project midpoint by Evolveum.
the class SqaleRepoModifyObjectTest method test115ChangeIntegerAttribute.
@Test
public void test115ChangeIntegerAttribute() throws ObjectAlreadyExistsException, ObjectNotFoundException, SchemaException {
OperationResult result = createOperationResult();
MService originalRow = selectObjectByOid(QService.class, service1Oid);
given("delta with display order change for service 1");
ObjectDelta<ServiceType> delta = prismContext.deltaFor(ServiceType.class).item(ServiceType.F_DISPLAY_ORDER).replace(5).asObjectDelta(service1Oid);
when("modifyObject is called");
repositoryService.modifyObject(ServiceType.class, service1Oid, delta.getModifications(), result);
then("operation is successful");
assertThatOperationResult(result).isSuccess();
and("serialized form (fullObject) is updated");
ServiceType serviceObject = repositoryService.getObject(ServiceType.class, service1Oid, null, result).asObjectable();
assertThat(serviceObject.getVersion()).isEqualTo(String.valueOf(originalRow.version + 1));
assertThat(serviceObject.getDisplayOrder()).isEqualTo(5);
and("externalized column is updated");
MService row = selectObjectByOid(QService.class, service1Oid);
assertThat(row.version).isEqualTo(originalRow.version + 1);
assertThat(row.displayOrder).isEqualTo(5);
}
Aggregations