Search in sources :

Example 6 with PasswordHistoryEntryType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.PasswordHistoryEntryType in project midpoint by Evolveum.

the class TestPasswordPolicyProcessor method test202createUserJackNoPasswordHistory.

@Test
public void test202createUserJackNoPasswordHistory() throws Exception {
    final String TEST_NAME = "test202createUserJackNoPasswordHistory";
    TestUtil.displayTestTile(TEST_NAME);
    // WHEN
    addObject(USER_JACK_FILE);
    // THEN
    PrismObject<UserType> userJack = getObject(UserType.class, USER_JACK_OID);
    assertNotNull("Expected to find user Jack, but no one exists here", userJack);
    UserType userJackType = userJack.asObjectable();
    CredentialsType credentials = userJackType.getCredentials();
    assertNotNull("User Jack has no credentials", credentials);
    PasswordType password = credentials.getPassword();
    assertNotNull("User Jack has no password", password);
    List<PasswordHistoryEntryType> historyEntries = password.getHistoryEntry();
    assertEquals("Expected no history entries, but found: " + historyEntries.size(), 0, historyEntries.size());
}
Also used : CredentialsType(com.evolveum.midpoint.xml.ns._public.common.common_3.CredentialsType) PasswordHistoryEntryType(com.evolveum.midpoint.xml.ns._public.common.common_3.PasswordHistoryEntryType) UserType(com.evolveum.midpoint.xml.ns._public.common.common_3.UserType) PasswordType(com.evolveum.midpoint.xml.ns._public.common.common_3.PasswordType) Test(org.testng.annotations.Test)

Aggregations

PasswordHistoryEntryType (com.evolveum.midpoint.xml.ns._public.common.common_3.PasswordHistoryEntryType)6 ItemPath (com.evolveum.midpoint.prism.path.ItemPath)3 PasswordType (com.evolveum.midpoint.xml.ns._public.common.common_3.PasswordType)3 ProtectedStringType (com.evolveum.prism.xml.ns._public.types_3.ProtectedStringType)3 CredentialsType (com.evolveum.midpoint.xml.ns._public.common.common_3.CredentialsType)2 UserType (com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)2 Test (org.testng.annotations.Test)2 PrismContainerValue (com.evolveum.midpoint.prism.PrismContainerValue)1 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)1 Task (com.evolveum.midpoint.task.api.Task)1 CredentialsStorageTypeType (com.evolveum.midpoint.xml.ns._public.common.common_3.CredentialsStorageTypeType)1 MetadataType (com.evolveum.midpoint.xml.ns._public.common.common_3.MetadataType)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 XMLGregorianCalendar (javax.xml.datatype.XMLGregorianCalendar)1