mirror of
https://github.com/nitnelave/lldap.git
synced 2023-04-12 14:25:13 +00:00
ldap: test message handler
This commit is contained in:
parent
656edc3763
commit
ea3142da5d
@ -770,13 +770,21 @@ mod tests {
|
|||||||
let mut ldap_handler =
|
let mut ldap_handler =
|
||||||
LdapHandler::new(mock, "dc=example,dc=com".to_string(), "test".to_string());
|
LdapHandler::new(mock, "dc=example,dc=com".to_string(), "test".to_string());
|
||||||
|
|
||||||
let request = LdapBindRequest {
|
let request = LdapOp::BindRequest(LdapBindRequest {
|
||||||
dn: "cn=bob,ou=people,dc=example,dc=com".to_string(),
|
dn: "cn=bob,ou=people,dc=example,dc=com".to_string(),
|
||||||
cred: LdapBindCred::Simple("pass".to_string()),
|
cred: LdapBindCred::Simple("pass".to_string()),
|
||||||
};
|
});
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
ldap_handler.do_bind(&request).await.0,
|
ldap_handler.handle_ldap_message(request).await,
|
||||||
LdapResultCode::Success
|
Some(vec![LdapOp::BindResponse(LdapBindResponse {
|
||||||
|
res: LdapResult {
|
||||||
|
code: LdapResultCode::Success,
|
||||||
|
matcheddn: "".to_string(),
|
||||||
|
message: "".to_string(),
|
||||||
|
referral: vec![],
|
||||||
|
},
|
||||||
|
saslcreds: None,
|
||||||
|
})]),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user