From ffabaf07c9649437beda8b1b8289fe0b2e0b6620 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Mon, 13 Nov 2023 09:44:40 -0500 Subject: [PATCH] chore: test idempotency is per-client --- tests/functional/stores/notification.rs | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/tests/functional/stores/notification.rs b/tests/functional/stores/notification.rs index 45731954..4892c0b9 100644 --- a/tests/functional/stores/notification.rs +++ b/tests/functional/stores/notification.rs @@ -55,17 +55,31 @@ async fn notification_multiple_clients_same_payload(ctx: &mut StoreContext) { blob: "example-payload".to_string(), }; - let client_id = create_client(&ctx.clients).await; + let client_id1 = create_client(&ctx.clients).await; let res = ctx .notifications - .create_or_update_notification(&message_id, TENANT_ID, &client_id, &payload) + .create_or_update_notification(&message_id, TENANT_ID, &client_id1, &payload) .await; assert!(res.is_ok()); - let client_id = create_client(&ctx.clients).await; + let client_id2 = create_client(&ctx.clients).await; let res = ctx .notifications - .create_or_update_notification(&message_id, TENANT_ID, &client_id, &payload) + .create_or_update_notification(&message_id, TENANT_ID, &client_id2, &payload) .await; assert!(res.is_ok()); + + let notification1 = ctx + .notifications + .get_notification(&message_id, &client_id1, TENANT_ID) + .await + .unwrap(); + assert_eq!(notification1.client_id, client_id1); + + let notification2 = ctx + .notifications + .get_notification(&message_id, &client_id2, TENANT_ID) + .await + .unwrap(); + assert_eq!(notification2.client_id, client_id2); }