Skip to content

Commit

Permalink
PrismContext.get() used in production code, not test getPrismContext()
Browse files Browse the repository at this point in the history
  • Loading branch information
virgo47 committed Aug 24, 2021
1 parent dc60374 commit 14c31e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
/*
* Copyright (c) 2020 Evolveum and contributors
* Copyright (C) 2020-2021 Evolveum and contributors
*
* This work is dual-licensed under the Apache License 2.0
* and European Union Public License. See LICENSE file for details.
*/

package com.evolveum.midpoint.model.impl.trigger;

import static com.evolveum.midpoint.prism.util.PrismTestUtil.getPrismContext;
import static com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType.F_TRIGGER;
import static com.evolveum.midpoint.xml.ns._public.common.common_3.TriggerType.F_TIMESTAMP;

import org.jetbrains.annotations.NotNull;

import com.evolveum.midpoint.model.impl.tasks.scanner.ScanActivityExecutionSpecifics;
import com.evolveum.midpoint.prism.PrismContext;
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.prism.query.ObjectFilter;
import com.evolveum.midpoint.prism.query.ObjectQuery;
Expand Down Expand Up @@ -56,7 +55,7 @@ public ObjectQuery customizeQuery(ObjectQuery configuredQuery, OperationResult r

private ObjectFilter createFilter() {
LOGGER.debug("Looking for triggers with timestamps up to {}", thisScanTimestamp);
return getPrismContext().queryFor(ObjectType.class)
return PrismContext.get().queryFor(ObjectType.class)
.item(F_TRIGGER, F_TIMESTAMP).le(thisScanTimestamp)
.buildFilter();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
/*
* Copyright (c) 2020 Evolveum and contributors
* Copyright (C) 2020-2021 Evolveum and contributors
*
* This work is dual-licensed under the Apache License 2.0
* and European Union Public License. See LICENSE file for details.
*/

package com.evolveum.midpoint.provisioning.impl.shadows.task;

import static com.evolveum.midpoint.prism.util.PrismTestUtil.getPrismContext;

import java.util.List;

import org.jetbrains.annotations.NotNull;

import com.evolveum.midpoint.prism.PrismContext;
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.prism.crypto.EncryptionException;
import com.evolveum.midpoint.provisioning.ucf.api.GenericFrameworkException;
Expand Down Expand Up @@ -61,7 +59,7 @@ public void beforeExecution(OperationResult opResult) throws CommonException {
public SearchSpecification<ShadowType> createSearchSpecification(OperationResult result) {
return new SearchSpecification<>(
ShadowType.class,
getPrismContext().queryFor(ShadowType.class)
PrismContext.get().queryFor(ShadowType.class)
.item(ShadowType.F_RESOURCE_REF).ref(resource.getOid())
.and()
.exists(ShadowType.F_PENDING_OPERATION)
Expand Down

0 comments on commit 14c31e2

Please sign in to comment.