From ba513b924bf56703e1124fcd535edaf292659b26 Mon Sep 17 00:00:00 2001 From: agrgr Date: Tue, 1 Oct 2024 13:25:11 +0300 Subject: [PATCH] update a test --- .../sync/AerospikeTemplateSaveWithDuplicatesTests.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/springframework/data/aerospike/core/sync/AerospikeTemplateSaveWithDuplicatesTests.java b/src/test/java/org/springframework/data/aerospike/core/sync/AerospikeTemplateSaveWithDuplicatesTests.java index 32616697..ed46c80a 100644 --- a/src/test/java/org/springframework/data/aerospike/core/sync/AerospikeTemplateSaveWithDuplicatesTests.java +++ b/src/test/java/org/springframework/data/aerospike/core/sync/AerospikeTemplateSaveWithDuplicatesTests.java @@ -57,7 +57,12 @@ public void shouldSaveAllVersionedDocumentsAndSetVersionAndThrowExceptionIfDupli assertThat(second.getVersion()).isSameAs(0); // An attempt to save the same versioned documents in one batch results in getting an exception - assertThatThrownBy(() -> template.saveAll(List.of(first, first, second, second))) + assertThatThrownBy(() -> template.saveAll(List.of(first, first))) + .isInstanceOf(OptimisticLockingFailureException.class) + .hasMessageFindingMatch("Failed to save the record with ID .* due to versions mismatch"); + + // An attempt to save the same versioned documents in one batch results in getting an exception + assertThatThrownBy(() -> template.saveAll(List.of(second, second))) .isInstanceOf(OptimisticLockingFailureException.class) .hasMessageFindingMatch("Failed to save the record with ID .* due to versions mismatch");