Example usage for javax.naming.directory InvalidAttributeValueException InvalidAttributeValueException

List of usage examples for javax.naming.directory InvalidAttributeValueException InvalidAttributeValueException

Introduction

In this page you can find the example usage for javax.naming.directory InvalidAttributeValueException InvalidAttributeValueException.

Prototype

public InvalidAttributeValueException() 

Source Link

Document

Constructs a new instance of InvalidAttributeValueException.

Usage

From source file:org.ligoj.app.plugin.id.ldap.dao.UserLdapRepositoryTest.java

@Test
public void setPasswordPolicyFail() throws NamingException {
    final UserOrg user = new UserOrg();
    user.setDn("cn=Any");
    final LdapContext mockCtx = newLdapContext();
    Mockito.doThrow(new InvalidAttributeValueException()).when(mockCtx)
            .modifyAttributes(ArgumentMatchers.eq("cn=Any"), ArgumentMatchers.any(ModificationItem[].class));
    MatcherUtil.assertThrows(//from   w w  w. java  2s.c om
            Assertions.assertThrows(ValidationJsonException.class,
                    () -> repository.setPassword(user, "old-password", "weak-password")),
            "password", "password-policy");
}