use of com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationStatusType in project midpoint by Evolveum.
the class OperationalDataManager method applyAssignmentValueMetadataAdd.
private <F extends FocusType> void applyAssignmentValueMetadataAdd(LensContext<F> context, PrismContainerValue<AssignmentType> assignmentContainerValue, String desc, XMLGregorianCalendar now, Task task, OperationResult result) throws SchemaException {
AssignmentType assignmentType = assignmentContainerValue.asContainerable();
MetadataType metadataType = assignmentType.getMetadata();
if (metadataType == null) {
metadataType = new MetadataType();
assignmentType.setMetadata(metadataType);
}
transplantRequestMetadata(context, metadataType);
ActivationType activationType = assignmentType.getActivation();
ActivationStatusType effectiveStatus = activationComputer.getEffectiveStatus(assignmentType.getLifecycleState(), activationType);
if (activationType == null) {
activationType = new ActivationType();
assignmentType.setActivation(activationType);
}
activationType.setEffectiveStatus(effectiveStatus);
applyCreateMetadata(context, metadataType, now, task);
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Adding operational data {} to assignment cval ({}):\nMETADATA:\n{}\nACTIVATION:\n{}", metadataType, desc, assignmentContainerValue.debugDump(1), activationType.asPrismContainerValue().debugDump(1));
}
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationStatusType in project midpoint by Evolveum.
the class TestActivationComputer method testCompute.
void testCompute(final String TEST_NAME, String lifecycleState, XMLGregorianCalendar now, ActivationStatusType administrativeStatus, XMLGregorianCalendar validFrom, XMLGregorianCalendar validTo, ActivationStatusType expectedEffective, TimeIntervalStatusType expectedValidity) {
// GIVEN
Clock clock = createClock(now);
ActivationComputer activationComputer = createActivationComputer(clock);
ActivationType activationType = createActivationType(administrativeStatus, validFrom, validTo);
// WHEN
activationComputer.computeEffective(lifecycleState, activationType);
// THEN
assertEquals("Unexpected effective status", expectedEffective, activationType.getEffectiveStatus());
assertEquals("Unexpected validity status", expectedValidity, activationType.getValidityStatus());
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationStatusType in project midpoint by Evolveum.
the class TestActivationComputer method testGetActiveAdministrativeEnabled.
@Test
public void testGetActiveAdministrativeEnabled() throws Exception {
System.out.println("\n===[ testGetActiveAdministrativeEnabled ]===\n");
// GIVEN
Clock clock = createClock(YEAR_START);
ActivationComputer activationComputer = createActivationComputer(clock);
ActivationType activationType = createActivationType(ActivationStatusType.ENABLED, SPRING_EQUINOX, AUTUMN_EQUINOX);
// WHEN
ActivationStatusType effectiveStatus = activationComputer.getEffectiveStatus(SchemaConstants.LIFECYCLE_ACTIVE, activationType);
// THEN
assertEquals("Unexpected effective status", ActivationStatusType.ENABLED, effectiveStatus);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationStatusType in project midpoint by Evolveum.
the class TestActivationComputer method testGetBeforeValidity.
@Test
public void testGetBeforeValidity() throws Exception {
System.out.println("\n===[ testGetBeforeValidity ]===\n");
// GIVEN
Clock clock = createClock(YEAR_START);
ActivationComputer activationComputer = createActivationComputer(clock);
ActivationType activationType = createActivationType(null, SPRING_EQUINOX, AUTUMN_EQUINOX);
// WHEN
ActivationStatusType effectiveStatus = activationComputer.getEffectiveStatus(null, activationType);
// THEN
assertEquals("Unexpected effective status", ActivationStatusType.DISABLED, effectiveStatus);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationStatusType in project midpoint by Evolveum.
the class TestActivationComputer method testGetAdministrativeEnabled.
@Test
public void testGetAdministrativeEnabled() throws Exception {
System.out.println("\n===[ testGetAdministrativeEnabled ]===\n");
// GIVEN
Clock clock = createClock(YEAR_START);
ActivationComputer activationComputer = createActivationComputer(clock);
ActivationType activationType = createActivationType(ActivationStatusType.ENABLED, SPRING_EQUINOX, AUTUMN_EQUINOX);
// WHEN
ActivationStatusType effectiveStatus = activationComputer.getEffectiveStatus(null, activationType);
// THEN
assertEquals("Unexpected effective status", ActivationStatusType.ENABLED, effectiveStatus);
}
Aggregations