[
https://issues.apache.org/jira/browse/DIRSERVER-1936?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
lucas theisen updated DIRSERVER-1936:
-------------------------------------
Attachment: PasswordPolicyAnnotationProcessingTestRule.java
ApplyPasswordPolicy.java
This implementation is an example. The annotation could probably remain
unmodified (except package should be changed to apache), but the
PasswordPolicyAnnotationProcessingTestRule functionality would probably be
better integrated into the FrameworkRunner though it could be left alone. As
such, you need to add the @Rule along with the annotation:
{code:java}
@Rule
public TestRule passwordPolicyAnnotationProcessingTestRule = new
PasswordPolicyAnnotationProcessingTestRule(
(AuthenticationInterceptor) getService().getInterceptor(
InterceptorEnum.AUTHENTICATION_INTERCEPTOR.getName() ) );
...
@Test
@ApplyPasswordPolicy(
pwdMustChange = true,
pwdMinAge = 5,
pwdCheckQuality = CheckQualityEnum.CHECK_ACCEPT )
public void testMinAge() throws LdapException, InterruptedException {
...
}
{code}
If you indeed are interested, I could supply a patch to the trunk. Let me know.
> Annotation based integration of password policy.
> ------------------------------------------------
>
> Key: DIRSERVER-1936
> URL: https://issues.apache.org/jira/browse/DIRSERVER-1936
> Project: Directory ApacheDS
> Issue Type: Improvement
> Components: core
> Affects Versions: 2.0.0-M16
> Reporter: lucas theisen
> Priority: Trivial
> Attachments: ApplyPasswordPolicy.java,
> PasswordPolicyAnnotationProcessingTestRule.java
>
>
> For my own unit testing purposes, I have added some additional annotations to
> add password policies via annotations. See attached classes. It makes for
> cleaner tests with more obvious settings. You may or may not want to
> integrate this approach, but I thought i would offer.
--
This message was sent by Atlassian JIRA
(v6.1.4#6159)