feat: test Identity.User for update_password
This commit is contained in:
parent
98fa1f21fc
commit
9d1be6a6e1
1 changed files with 25 additions and 0 deletions
|
@ -313,4 +313,29 @@ mod tests {
|
|||
.when(IdentityCommand::OwnerAddEmployeeToStore(cmd))
|
||||
.then_expect_events(vec![expected]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_user_aggregate_update_password() {
|
||||
use crate::identity::application::services::update_password::{
|
||||
command::*, events::*, service::*, *,
|
||||
};
|
||||
|
||||
let cmd = UpdatePasswordCommand::get_cmd();
|
||||
let expected = PasswordUpdatedEvent::get_event(&cmd);
|
||||
let expected = IdentityEvent::PasswordUpdated(expected);
|
||||
|
||||
let mut services = MockIdentityServicesInterface::new();
|
||||
services
|
||||
.expect_update_password()
|
||||
.times(IS_CALLED_ONLY_ONCE.unwrap())
|
||||
.return_const(UpdatePasswordService::mock_service(
|
||||
IS_CALLED_ONLY_ONCE,
|
||||
cmd.clone(),
|
||||
));
|
||||
|
||||
UserTestFramework::with(Arc::new(services))
|
||||
.given_no_previous_events()
|
||||
.when(IdentityCommand::UpdatePassword(cmd))
|
||||
.then_expect_events(vec![expected]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue