Skip to content

Commit

Permalink
Fixed provisioning tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Sep 23, 2017
1 parent 1d81756 commit 8143636
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Expand Up @@ -4442,12 +4442,12 @@ protected String getTopOrgOid() {
protected void transplantGlobalPolicyRulesAdd(File configWithGlobalRulesFile, Task task, OperationResult parentResult) throws SchemaException, IOException, ObjectNotFoundException, ObjectAlreadyExistsException, ExpressionEvaluationException, CommunicationException, ConfigurationException, PolicyViolationException, SecurityViolationException {
// copy rules from the file into live system config object
PrismObject<SystemConfigurationType> rules = prismContext.parserFor(configWithGlobalRulesFile).parse();
ObjectDelta<SystemConfigurationType> delta = (ObjectDelta<SystemConfigurationType>) DeltaBuilder.deltaFor(SystemConfigurationType.class, prismContext)
ObjectDelta<SystemConfigurationType> delta = DeltaBuilder.deltaFor(SystemConfigurationType.class, prismContext)
.item(SystemConfigurationType.F_GLOBAL_POLICY_RULE).add(
rules.asObjectable().getGlobalPolicyRule().stream()
.map(r -> r.clone().asPrismContainerValue())
.collect(Collectors.toList()))
.asObjectDelta(SystemObjectsType.SYSTEM_CONFIGURATION.value());
.asObjectDeltaCast(SystemObjectsType.SYSTEM_CONFIGURATION.value());
modelService.executeChanges(MiscSchemaUtil.createCollection(delta), null, task, parentResult);
}

Expand Down
Expand Up @@ -573,10 +573,14 @@ private void applyShadowAttributeDefinitions(Class<? extends RAnyValue> anyValue
if (item.getDefinition() == null) {
RValueType rValType = (RValueType) value[2];
if (rValType == RValueType.PROPERTY) {
PrismPropertyDefinition<Object> def = new PrismPropertyDefinitionImpl<>(name, type, object.getPrismContext());
PrismPropertyDefinitionImpl<Object> def = new PrismPropertyDefinitionImpl<>(name, type, object.getPrismContext());
def.setMinOccurs(0);
def.setMaxOccurs(-1);
item.applyDefinition(def, true);
} else if (rValType == RValueType.REFERENCE) {
PrismReferenceDefinition def = new PrismReferenceDefinitionImpl(name, type, object.getPrismContext());
PrismReferenceDefinitionImpl def = new PrismReferenceDefinitionImpl(name, type, object.getPrismContext());
def.setMinOccurs(0);
def.setMaxOccurs(-1);
item.applyDefinition(def, true);
} else {
throw new UnsupportedOperationException("Unsupported value type " + rValType);
Expand Down

0 comments on commit 8143636

Please sign in to comment.