Skip to content

Commit

Permalink
Tests for passwork policy check expression (MID-4997)
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed Dec 17, 2018
1 parent 32e329a commit e55ef0a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Expand Up @@ -160,7 +160,7 @@ public <O extends ObjectType> String generate(ItemPath path, ValuePolicyType pol
}
LOGGER.trace("Generator attempt {}: check failed", attempt);
if (attempt == maxAttempts) {
ExpressionEvaluationException e = new ExpressionEvaluationException("Unable to generate value, maximum number of attempts exceeded");
ExpressionEvaluationException e = new ExpressionEvaluationException("Unable to generate value, maximum number of attempts ("+maxAttempts+") exceeded");
result.recordFatalError(e);
throw e;
}
Expand Down
Expand Up @@ -1550,6 +1550,7 @@ public void test320ReconcileDummyAzureDeleteOtis() throws Exception {
/**
* Create account that will correlate to existing user.
* See that it is linked and modified.
* MID-4997
*/
@Test
public void test330ReconcileDummyAzureAddAccountRapp() throws Exception {
Expand Down Expand Up @@ -1621,6 +1622,8 @@ public void test330ReconcileDummyAzureAddAccountRapp() throws Exception {
}

assertNotNull("No clear text password", stringPassword);
assertTrue("Rapp's password is supposed to contain letter a: "+stringPassword, stringPassword.contains("a"));


PrismObject<ValuePolicyType> passwordPolicy = getObjectViaRepo(ValuePolicyType.class, PASSWORD_POLICY_LOWER_CASE_ALPHA_AZURE_OID);

Expand Down
Expand Up @@ -60,6 +60,14 @@
<value>1234567890</value>
</characterClass>
</limit>
<checkExpression>
<expression> <!-- MID-4997 -->
<script>
<code>return input.contains('a')</code>
</script>
</expression>
</checkExpression>
<maxAttempts>50</maxAttempts>
</limitations>
</stringPolicy>
</valuePolicy>

0 comments on commit e55ef0a

Please sign in to comment.