public PasswordType historyEntry(PasswordHistoryEntryType value) { getHistoryEntry().add(value); return this; }
protected void assertPasswordHistoryEntries(PasswordType passwordType, String... changedPasswords) { assertPasswordHistoryEntries(passwordType.getHistoryEntry(), changedPasswords); }
public List<PasswordHistoryEntryType> createHistoryEntryList() { PrismForJAXBUtil.createContainer(asPrismContainerValue(), F_HISTORY_ENTRY); return getHistoryEntry(); }
protected void assertPasswordHistoryEntries(PrismObject<UserType> user, String... changedPasswords) { CredentialsType credentials = user.asObjectable().getCredentials(); assertNotNull("Null credentials in "+user, credentials); PasswordType passwordType = credentials.getPassword(); assertNotNull("Null passwordType in "+user, passwordType); assertPasswordHistoryEntries(user.toString(), passwordType.getHistoryEntry(), getPasswordHistoryStorageType(), changedPasswords); }
@Test public void test202createUserJackNoPasswordHistory() throws Exception { final String TEST_NAME = "test202createUserJackNoPasswordHistory"; TestUtil.displayTestTitle(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()); }
private void modifyUserJackPasswordNoHistory(String TEST_NAME) throws Exception{ TestUtil.displayTestTitle(TEST_NAME); Task task = taskManager.createTaskInstance(TEST_NAME); OperationResult result = task.getResult(); // WHEN ProtectedStringType newValue = new ProtectedStringType(); newValue.setClearValue("n0Hist0ryEntr7"); modifyObjectReplaceProperty(UserType.class, USER_JACK_OID, PATH_CREDENTIALS_PASSWORD_VALUE, task, result, newValue); // 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()); }