Skip to content

Commit

Permalink
revert to using upsert (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
harshit-kumar-v2 authored Aug 28, 2024
1 parent 6620851 commit 829a71c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public UpsertedConfig writeConfig(
.asRuntimeException();
}
} else {
collection.createOrReplace(latestDocKey, latestConfigDocument);
collection.upsert(latestDocKey, latestConfigDocument);
}

return optionalPreviousConfig
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void WriteConfigForCreate() throws IOException {

ArgumentCaptor<Key> keyCaptor = ArgumentCaptor.forClass(Key.class);
ArgumentCaptor<Document> documentCaptor = ArgumentCaptor.forClass(Document.class);
verify(collection, times(1)).createOrReplace(keyCaptor.capture(), documentCaptor.capture());
verify(collection, times(1)).upsert(keyCaptor.capture(), documentCaptor.capture());

Key key = keyCaptor.getValue();
Document document = documentCaptor.getValue();
Expand Down Expand Up @@ -129,7 +129,7 @@ void WriteConfigForUpdateWithoutUpsertCondition() throws IOException {

ArgumentCaptor<Key> keyCaptor = ArgumentCaptor.forClass(Key.class);
ArgumentCaptor<Document> documentCaptor = ArgumentCaptor.forClass(Document.class);
verify(collection, times(1)).createOrReplace(keyCaptor.capture(), documentCaptor.capture());
verify(collection, times(1)).upsert(keyCaptor.capture(), documentCaptor.capture());

Key key = keyCaptor.getValue();
Document document = documentCaptor.getValue();
Expand Down

0 comments on commit 829a71c

Please sign in to comment.