use of com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType 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.ActivationType 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);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType in project midpoint by Evolveum.
the class TestActivationComputer method testGetAdministrativeDisabled.
@Test
public void testGetAdministrativeDisabled() throws Exception {
System.out.println("\n===[ testGetAdministrativeDisabled ]===\n");
// GIVEN
Clock clock = createClock(SUMMER_SOLSTICE);
ActivationComputer activationComputer = createActivationComputer(clock);
ActivationType activationType = createActivationType(ActivationStatusType.DISABLED, 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.ActivationType in project midpoint by Evolveum.
the class TestActivationComputer method testGetActiveAdministrativeDisabled.
@Test
public void testGetActiveAdministrativeDisabled() throws Exception {
System.out.println("\n===[ testGetActiveAdministrativeDisabled ]===\n");
// GIVEN
Clock clock = createClock(YEAR_START);
ActivationComputer activationComputer = createActivationComputer(clock);
ActivationType activationType = createActivationType(ActivationStatusType.DISABLED, SPRING_EQUINOX, AUTUMN_EQUINOX);
// WHEN
ActivationStatusType effectiveStatus = activationComputer.getEffectiveStatus(SchemaConstants.LIFECYCLE_ACTIVE, activationType);
// THEN
assertEquals("Unexpected effective status", ActivationStatusType.DISABLED, effectiveStatus);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType in project midpoint by Evolveum.
the class ActivationComputer method isActive.
public boolean isActive(String lifecycleStatus, ActivationType activationType) {
if (activationType == null) {
return true;
}
ActivationStatusType effectiveStatus = activationType.getEffectiveStatus();
if (effectiveStatus == null) {
computeEffective(lifecycleStatus, activationType);
effectiveStatus = activationType.getEffectiveStatus();
}
if (effectiveStatus == null) {
return false;
}
return effectiveStatus == ActivationStatusType.ENABLED;
}
Aggregations