Skip to content

Commit

Permalink
update a test
Browse files Browse the repository at this point in the history
  • Loading branch information
agrgr committed Oct 1, 2024
1 parent 33f59aa commit ba513b9
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down

0 comments on commit ba513b9

Please sign in to comment.