Усилить безопасность и надёжность выполнения операций
This commit is contained in:
@@ -75,6 +75,18 @@ async fn destructive_operation_requires_single_use_confirmation() {
|
||||
RuntimeError::InvalidConfirmationToken { .. }
|
||||
));
|
||||
assert_eq!(call_count.load(Ordering::SeqCst), 1);
|
||||
|
||||
let approved_context = context.with_approval_granted();
|
||||
let approved = executor
|
||||
.execute_with_context(
|
||||
&operation,
|
||||
&json!({ "order_id": "ord_123" }),
|
||||
Some(&approved_context),
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(approved, json!({ "deleted": true }));
|
||||
assert_eq!(call_count.load(Ordering::SeqCst), 2);
|
||||
}
|
||||
|
||||
struct CountingAdapter {
|
||||
|
||||
Reference in New Issue
Block a user